Burst Blockchain

From Burstwiki
Jump to: navigation, search
The Burst Blockchain
Status UpToDateW.png

Table Of Contents

Introduction

The Burst Blockchain is the digital ledger in which transactions (including AT, Escrow, Messages, etc) made in Burstcoin are recorded chronologically and publicly. All these informations are stored on the Blockchain, in a H2 or MariaDB database.

Database Fields

All the blockchain is stored on these tables :

Burst Blockchain Diagram.png

1. Block Table

These 19 fields define a block on the blockchain in the current version of the Burst software.

Field Name Data Type NOT NULL
db_id BIGINT(20) yes
id BIGINT(20) yes
version INTEGER(11) yes
timestamp INTEGER(11) yes
previous_block_id BIGINT(20) no
total_amount BIGINT(20) yes
total_fee BIGINT(20) yes
payload_length INTEGER(11) yes
generator_public_key VARBINARY(32) yes
previous_block_hash VARBINARY(32) no
cumulative_difficulty BLOB yes
base_target BIGINT(20) yes
next_block_id BIGINT(20) no
height INTEGER(11) yes
generation_signature VARBINARY(64) yes
block_signature VARBINARY(64) yes
payload_hash VARBINARY(32) yes
nonce BIGINT(20) yes
ats BLOB ?

Note: the block table has evolved since the genesis block.

Note: most fields cannot be NULL. The exceptions are the previous_... and next_... fields which link the blocks into a chain both forward and backward. The genesis block has a NULL previous_block_id and the last (current) block has a NULL next_block_id.

Below the column list is a list of indexes. The indexes are all used for sorting various columns for fast retrieval, but the following columns are also restricted to have unique values: db_id, height, id, timestamp. They are all used to uniquely identify blocks. db_id is the autoincrement field of the table. It normally increases by one with each new block but gaps can occur in the sequence due to occasional deleted blocks. height is zero for the genesis block and increases by one with each block in the blockchain. There are no gaps in this sequence. id is a unique block id derived from the hash of some of the block fields. timestamp is the block creation time measured in number of seconds elapsed since the genesis block.

Note: blocks stored in the BLOCK table are associated with transactions stored in the transaction table through the fields payload_length and payload_hash, and total_amount and total_fee. payload_length is the total number of bytes of certain fields of all transactions associated with the block and payload_hash is the hash of all those fields. total_amount and total_fee are the total amounts and fees of all transactions associated with the block. All four of these block fields are zero when there are no transactions associated with the block.

2. TRANSACTION Table

These 25 fields define a transaction the current version of the Burst software. Note that the transaction table has evolved since the genesis block.

Field Name Data Type NOT NULL
db_id BIGINT(20) yes
id BIGINT(20) yes
deadline SMALLINT(6) yes
sender_public_key VARBINARY(32) yes
recipient_id BIGINT(20) no
amount BIGINT(20) yes
fee BIGINT(20) yes
height INTEGER(11) yes
block_id BIGINT(20) yes
signature VARBINARY(64) yes
timestamp INTEGER(11) yes
type TINYINT(4) yes
subtype TINYINT(4) yes
sender_id BIGINT(20) yes
block_timestamp INTEGER(11) yes
full_hash VARBINARY(32) yes
referenced_transaction_full_hash VARBINARY(32) no
attachments_bytes BLOB no
version TINYINT(4) yes
has_message BOOLEAN(1) yes
has_encrypted_message BOOLEAN(1) yes
has_public_key_announcement BOOLEAN(1) yes
ec_block_height INTEGER(11) no
ec_block_id BIGINT(20) no
has_encrypttoself_message BOOLEAN(1) yes

Note: most fields cannot be NULL. The exceptions are recipient_id, referenced_transaction_full_hash, attachments_bytes and the ec_block_... fields. A transaction is valid without any of these fields specified.

Below the column list is a list of indexes. The indexes are all used for sorting various columns for fast retrieval, but the following columns are also restricted to have unique values: db_id, id, full_hash.

Note: transactions stored in the TRANSACTION table are associated with blocks stored in the BLOCK table through the fields height, block_id and block_timestamp.

All other tables, with field names, and data types are listed in the image above.