This page describes the various structures of the Ellcrys blockchain.
A block is a container data structure. It is composed of a header and a collection of transactions. Transactions are collected into a block and cryptographically linked to another block to form a chain of blocks. A block has a limited size; In Bitcoin, a block's size is set at 1MB, whereas In Bitcoin Cash, the size of a block is set at 8MB. The larger the block size, the more transactions can be processed per second. Ellcrys' block size is set at 10MB.
An Ellcrys block is composed of a header, a list of transactions, a block hash and a signature.
The header contains metadata about the block. It includes information about the current block number, proof-of-work proof, current and total difficulty, current state root hash and the hash of the previous block. The following code is an example structure of an Ellcrys header:
In most blockchain systems, transactions are the driving force and initiator of action. They are created by users or (smart contracts) to perform a specific function such as moving money from one account to another account. Transactions are signed and sent to a node on the network and subsequently included into a block.
Balance: A balance transaction moves money from one account to another account; It is the most common transaction that is capable of changing the balance of users' account.
var TxTypeBalance = 0x1
Allocation: An allocation transaction is used to allocate new coins to users. They are used extensively in the genesis block to distribute initial coin supply. According to protocol specification, miners are expected to include an allocation transaction for paying transaction fees to themselves.
var TxTypeAlloc = 0x2
The structure of a transaction includes information about the type of the transaction, financial information, destination address, authorising signature and more. Here is a sample of a transaction:
The hash is a 32 bytes Blake2b-256 hash. It is composed of a concatenation of the header and transactions. A block is considered invalid if the computed hash does not match the hash included in the block.
The signature of a block is created using the private key of the block creator to produce a 64 bytes output. The signed data is composed of the block's header and transactions.