Burstcoin blockchain technical information

 The Burstcoin blockchain is the digital ledger in which Burstcoin transactions are recorded chronologically and publicly (including smart contracts, Escrow, Messages, etc.).  All of this information is stored in an H2 or MariaDB database.  Burstcoin’s blockchain is kept to a reasonable size using data scrubbing. 

All blockchain data is stored in the following database tables:

Image showing a diagram of the Burstcoin blockchain database fields

Block table

These 19 fields define a block in the current version of the Burstcoin software.  Note that the block table has evolved since the genesis block.

Field NameData TypeNOT NULL
db_idBIGINT(20)yes
idBIGINT(20)yes
versionINTEGER(11)yes
timestampINTEGER(11)yes
previous_block_idBIGINT(20)no
total_amountBIGINT(20)yes
total_feeBIGINT(20)yes
payload_lengthINTEGER(11)yes
generator_public_keyVARBINARY(32)yes
previous_block_hashVARBINARY(32)no
cumulative_difficultyBLOByes
base_targetBIGINT(20)yes
next_block_idBIGINT(20)no
heightINTEGER(11)yes
generation_signatureVARBINARY(64)yes
block_signatureVARBINARY(64)yes
payload_hashVARBINARY(32)yes
nonceBIGINT(20)yes
atsBLOB?

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 identify blocks uniquely. db_id is the auto-increment field of the table. It usually 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. 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 the 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.

Transaction table

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

Field NameData TypeNOT NULL
db_idBIGINT(20)yes
idBIGINT(20)yes
deadlineSMALLINT(6)yes
sender_public_keyVARBINARY(32)yes
recipient_idBIGINT(20)no
amountBIGINT(20)yes
feeBIGINT(20)yes
heightINTEGER(11)yes
block_idBIGINT(20)yes
signatureVARBINARY(64)yes
timestampINTEGER(11)yes
typeTINYINT(4)yes
subtypeTINYINT(4)yes
sender_idBIGINT(20)yes
block_timestampINTEGER(11)yes
full_hashVARBINARY(32)yes
referenced_transaction_full_hashVARBINARY(32)no
attachments_bytesBLOBno
versionTINYINT(4)yes
has_messageBOOLEAN(1)yes
has_encrypted_messageBOOLEAN(1)yes
has_public_key_announcementBOOLEAN(1)yes
ec_block_heightINTEGER(11)no
ec_block_idBIGINT(20)no
has_encrypttoself_messageBOOLEAN(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.

5 + 5 =