Block

In contrast to centralized systems where client requests are processed in a sequential manner, decentralized systems, like peer-to-peer networks, allow users to submit data through any node, leading to transactions being received in varying orders by different nodes.

Blockchain technology addresses the challenge of establishing a consistent order for all transactions disseminated across the network. Through a pseudo-random selection process, nodes are tasked with adding groups of transactions, known as blocks, to the collective transaction history of the network. Each block, containing transactions and additional data, is securely linked to the preceding block using cryptographic hashes in its metadata, forming a chain — hence the term “blockchain.” This linkage means altering any block’s data would necessitate the reconstruction of all following blocks, ensuring the integrity of the transaction history.

Structure of a block

Unlike centralized systems where tasks are done one by one, decentralized systems, such as peer-to-peer networks, let users send information through any of the system’s parts. This means that transactions can arrive in different orders at different places.

Blockchain technology solves the problem of how to put all these transactions in a specific order across the whole network. It does this by selecting nodes in a sort of random way to group transactions into blocks. These blocks, which hold transactions and some extra information, are then linked together in order. Each block is connected to the one before it by special codes called cryptographic hashes, creating a chain — that’s why it’s called “blockchain.” If you wanted to change information in one block, you’d have to change all the blocks that come after it, which helps keep all the transaction records safe and unchanged.

Block creation and protection from modification.

In the context of the Savitri blockchain, the process of block creation and its protection from undue modification are key aspects in ensuring the security and integrity of the network. The creation of a block in a blockchain is an operation that, if not properly controlled, could leave room for manipulation by block creators, thus compromising the entire system.

Hash Function and Entropy

The hash function plays a crucial role in block creation, producing a unique hash value from a set of input data. This function is designed to generate output that appears as uniformly distributed random numbers, independent of the input data. Although a block hash may seem like a good source of entropy, i.e. randomness, exploiting it in such a way can be dangerous. An attacker, having the possibility of altering certain elements of the block such as transaction order, timestamp or other data, could repeatedly attempt to modify the block until a ‘favourable’ hash is obtained that would allow him to manipulate the blockchain.

Introduction of the Block Seed

The calculation of the block seed is done through a formula that guarantees its unpredictability and uniqueness:

new_block_seedH=hash(creator_signatureH(hash(block_seedH-1+block_metadataH)))

Where:

– new_block_seedH is the seed of the current block we are calculating.

– creator_signatureH is the digital signature of the creator of the current block, applied to the combination of the hash of the previous block’s seed and the current block’s metadata.

– block_seedH-1 is the seed of the previous block.

– block_metadataH includes additional data of the current block, such as the block number, timestamp, and hash of the current block’s header, thus increasing the entropy of the seed.

Process Description

1.            Data Combination: Instead of directly signing the seed hash of the previous block, the block creator combines this hash with the metadata of the current block. This step introduces an additional layer of unique data that makes the seed more unpredictable.

2.            Application of the Digital Signature: The block creator applies its digital signature to the combination of the seed hash of the previous block and the metadata of the current block, ensuring that the seed cannot be generated without the creator’s private key.

3.            Calculation of the Final Hash: Finally, the hash of the signature result provides the new seed of the block. This step ensures that the final seed is a fixed hash value that is independent of the length of the signature, uniformly distributed and difficult to predict without knowing the signature and the initial data.

Use of the Digital Signature Algorithm Ed25519

Savitri adopts the Ed25519 digital signature algorithm for creating block seeds, known for its efficiency and security. A key advantage of Ed25519 is that there is only one possible signature per message and per private key. This eliminates the possibility for the block creator to choose between several potential signatures, forcing him to accept the block seed generated by the protocol without the possibility of alteration.

Block creation:

Within the context of “node registration,” where the complete set of potential block creators is known, Savitri employs a method that, following each block, pseudo-randomly generates a priority-ordered list of nodes tasked with creating the next block. If a node fails to produce a block when it’s their turn (due to being offline, network issues, or voluntary omission), its participation score is decreased. In such cases, the network waits for a block from the next node in the randomly ordered list.

Alternative algorithm for block creator selection:

To make the block creator selection process more resilient and distributed, an algorithm based on “weighted voting” and “commitment” concepts could be considered. In this scenario, every node in the network can participate in the selection of the block creator through a voting mechanism that accounts for not only the presence of the node but also its reliability and contribution to the network.

Algorithm Definition:

Commitment Weight Calculation (CWC): Each node commits a certain amount of resources (e.g., computing power, storage, bandwidth) for a specified period. This commitment is measurable and is used to calculate a “Commitment Weight” for each node.

NodeWeight = f(resourceCommitment)

Where f is a function that maps resource commitment into a numerical weight.

Weighted Voting: When it’s time to select the block creator, every node participates in a voting process. The vote of each node is weighted based on its Commitment Weight, with nodes that have committed more resources having more weight in the decision.

Block Creator Selection:

a. A unique hash value for the last confirmed block is calculated, serving as the seed for the pseudo-random selection.

b. Using the seed, the block creator is selected based on the weighted distribution of votes.

blockCreator = pseudoRandomSelection(hash(lastBlock), weightedDistribution)

Failure to Create Handling: If the selected node fails to create the block within a predetermined time, its Commitment Weight is reduced, affecting its future selection capability. The selection process is then repeated excluding the failed node.

This algorithm aims to incentivize nodes to maintain a high level of commitment and reliability, as their ability to influence the block creator selection and earn rewards is directly proportional to their commitment to the network.