Gerating and collecting receipts
In the Savitri network, when one node sends data like a transaction or block to another, the receiver, upon verifying the data, generates a receipt to acknowledge the transfer. This process is done even if the data was previously received from a different source, provided it is valid.
Here’s a simplified breakdown of how it works:
- Generating Receipts: After receiving and validating data, the receiving node creates a receipt. This receipt includes:
- The sender’s public key (who sent the data).
- The receiver’s public key (its own).
- The type of data (block, transaction, etc.).
- The hash of the data.
- The current block height and hash from the receiver’s perspective.
- The vote from different parameters
Merkle Root Inclusion: The receiver adds a Merkle root from its batch table to the receipt. While other nodes can’t directly check this, it’s crucial for the receiver to accurately include this for future validations of data transmissions.
Signing and Returning: The receiver signs the receipt with its private key to certify its creation and sends it back to the sender. If a node consistently fails to return valid receipts, it risks being blacklisted.
Organizing Receipts:
When nodes send data, they collect receipts from those who receive them. These receipts are grouped into batches and each batch has a Merkle root representing the combined evidence of those transactions.
Batch limits: There is a limit to the number of receipts that can be included in a single Merkle root, encouraging nodes to discard receipts that will not be useful for future proofs, such as those that do not align with peer filters.
Scoring: In Proof of Unity, scoring is the key aspect of block allocation, this together with the lottery will incentivise teamwork. The score is calculated according to several parameters some examples are:
- Amount of coins blocked
- Amount of time the node has participated in the network
- Quality of data
- Timeliness of transmission
- Volume of data transmitted
- Contribution with votes for network choices
Database storage and finalisation:
Receipts are stored in memory until the node is ready to finalise a batch. The node calculates the Merkle root for the batch and stores this information in the database, linking it to the block height in which it was created. Each receipt within the batch is also saved, labelled with the Merkle root of the batch and its sequence number in the batch.
This method allows nodes to keep track of their interactions within the network, preparing them to prove their active participation and support the network’s Proof of Unity. This process ensures a transparent and accountable network, promoting efficiency and integrity in data propagation.
In the Savitri network, nodes share data as transactions or blocks and confirm these transmissions through receiving objects. This is how the process is simplified and made secure:
Receipt production:
When one node sends data to another, the recipient, after confirming its validity, generates a receipt. This receipt includes details such as the public keys of the sender and receiver, the data type, the hash of the data, the height of the reference block and the hash of that block. It also contains a Merkle root related to the data batch, which helps in subsequent validations.
Receipt Management:
The nodes collect these receipts in batches, calculating a Merkle root for each one to aid future verification processes. Receipts that are unlikely to be needed for future verification can be discarded, optimising storage and focusing on relevant data exchanges.
Remove old receipts:
Receipts expire after a certain period, depending on the block height indicated within them. Nodes periodically remove these expired receipts to maintain a lean and efficient database, ensuring that the system’s memory footprint remains constant.