Signum Blockchain
Signum Blockchain Technical Information
The Signum blockchain is the digital ledger in which Signum transactions are recorded chronologically and publicly (including smart contracts, Escrow, Messages, etc.). All of this information is stored in an H2 or MariaDB database. Signum blockchain is kept to a reasonable size using data scrubbing.
All blockchain data is stored in the following database tables:
Block Table
These 19 fields define a block in the current version of the Signum software. Note that the block table has evolved since the genesis block.
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 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 Signum 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.