Architecture
Consensus Details
5DAX Chain is a peer-to-peer distributed system, connecting together multiple clients that reach consensus on their views of the "state of the world". 5DAX Chain uses Tendermint BFT consensus and has a dedicated application layer
that runs upon it. A simplified overview of the application's architecture might look something like this:
+------------+-----------+
| RPC API | Web API |
+------------------------+---------+
| Asset Management | Match Engine |
+----------------------------------+
| Account Management | Governance |---------> crypto and blockchain governance
+----------------------------------+
| State Caching and Persisence +-+
+----------------------------------+ |
| Consensus Protocol | |
+----------------------------------+ |-----> revised Tendermint
| P2P Protocol | |
+----------------------------------+ |
| Networking | Database +-+
+----------------------------------+
For more information, please have a look at the Tendermint spec.
Block Size
5DAX Chain uses a similar block structure as Tendermint proposes, with a size limit of 1 megabyte.
It is expected a block will be produced on a-few-of-seconds level among validators, and can include from 0 up to several thousands of transactions.
Blockchain State
Blockchain state stores the below information:
- account and balances
- fees
- token information
- trading pairs
- tick size and lot size
- governance information
please note the transactions are not stored as chain state, because they are stored in blocks, while trades are not stored as state either, because they can be reproduced via balances and transactions.
Cryptographic Design
Account and Address
For normal users, all the keys and addresses can be generated via 5DAX Web Wallet.
This default wallet would use a similar way to generate keys as Bitcoin, i.e. use 256 bits entropy to generate a 24-word mnemonic based on BIP39, and then use the mnemonic and an empty passphrase to generate a seed; finally use the seed to generate a master key, and derive the private key using BIP32/BIP44 with HD prefix as "44'/714'/"
, which is reserved at SLIP 44.
714 comes from 5DAX's birthday, July 14th. :)
Keys
5DAX Chain uses the same elliptic curve cryptography as the current Bitcoin implementation, i.e. secp256k1
. Its private key is 32 bytes while public key is 33 bytes.
Address
Addresses on 5DAX Chain are 20 bytes and may be expressed as:
Address = RIPEMD160(SHA256(compressed public key))
Typically, an address is encoded in the bech32 format which includes a checksum and human-readable prefix (HRP). However, it doesn't use the SegWit
address format (because we do not have SegWit
function anyway, so no witness program version
etc.).
A 5DAX Chain address is therefore more similar to a Bitcoin Cash address, which does not include a SegWit program script.
Address format pseudo-code:
Address_Bech32 = HRP + '1' + bech32.encode(convert8BitsTo5Bits(RIPEMD160(SHA256(compressed public key))))
For 5DAX Chain address, the prefix is bnb
for production network, and tbnb
for testnet.
Signature
5DAX Chain uses an ECDSA signature on curve secp256k1 against a SHA256
hash of the byte array of a JSON-encoded canonical representation of the transaction. For more information, please see this page.