New block types
CORE
The new version presumes blocks with technical information on the blockchain in addition to the existing ones:
- blocks of block confirmation,
- blocks of rejected transaction information.
New blocks go along with the main ones. First comes the block size in int64 format, then the block itself.
Confirmation Blocks
They are introduced for more timely provision of blocks confirmation information to the main chain. Also, there is an option to confirm forging blocks and state blocks without a need to create a regular block.
Block format:
№ | Name | Type | Size | Description |
---|---|---|---|---|
1 | block_type | uint64_t | 8 | Block type - 0x1100111167452301 |
2 | block_timestamp | uint64_t | 8 | Block creation time |
3 | prev_hash | array | 32 | Block hash to which confirmations belong |
4 | tx_size | varint | 1-9 | Confirmation transaction size |
5 | ApproveRecord | array | tx_size | Confirmation transaction |
6 | ... | Steps 4 and 5 Not step 7 | ||
7 | tx_size = 0 | varint | 1 | If transaction size is zero, a block ends |
Confirmation transaction format:
№ | Name | Type | Size | Description |
---|---|---|---|---|
1 | block_hash | array | 32 | Block hash which is confirmed |
2 | sign_size | varint | 1-9 | Signature size |
3 | sign | array | sign_size | Hash signature |
4 | pubk_size | varint | 1-9 | Public key size |
5 | pub_key | array | pubk_size | The public key by which the hash was signed |
Information blocks of rejected transactions
They inform users about the reasons for transaction rejection by the Core.
Block format:
1 | block_type | uint64_t | 8 | Block type - 0x3300111167452301 |
2 | block_timestamp | uint64_t | 8 | Block creation time |
3 | block_timestamp | array | 32 | Block hash with the relevance of which transactions were rejected |
4 | sign_size | varint | 1-9 | Signature size |
5 | sign | array | sign_size | Transaction signature (from the public key end to the block end) |
6 | pubk_size | varint | 1-9 | Public key size |
7 | pubk | array | pubk_size | The public key by which transactions were signed |
8 | tx_size | varint | 1-9 | Confirmation transaction size |
9 | RejectedTXInfo | array | tx_size | Confirmation transaction |
10 | ... | Steps 8 and 9 Not step 11 | ||
11 | tx_size = 0 | varint | 1 | If transaction size is zero, a block ends |
Confirmation transaction format:
№ | Name | Type | Size | Description |
---|---|---|---|---|
1 | tx_hash | array | 32 | Hash of reject transaction |
2 | reason | varint | 1-9 | Error code that rejected the transaction |
Decoding error codes:
№ | Reason | Code |
---|---|---|
1 | A transaction was sent from a zero wallet | 0xff01 |
2 | The fee is not enough to send a transaction | 0xff02 |
3 | There is not enough funds in wallet to complete a transaction | 0xff03 |
4 | There is a wrong nonce | 0xff04 |
5 | There is not enough funds in wallet to complete a transaction | 0xff05 |
6 | There is an invalid sender or receiver address format | 0x0404 |
Updated about 5 years ago