Chain Hashing
Chain Hashing in Write Markers is a mechanism designed to enhance the efficiency and security of data verification and payment settlement on the blockchain. Instead of submitting individual Write Markers sequentially—which increases transaction costs and slows down processing speeds—blobbers create a chain of Write Markers. This chain is verified using cryptographic hashing, ensuring data correctness and reducing blockchain congestion.
Problem Statement
Blobbers must submit Write Markers to the blockchain to prove they have stored a specific amount of data. This proof is essential for:
Enabling challenges that verify data integrity.
Processing payments for storage services.
Maintaining an auditable record of data transactions.
However, submitting each Write Marker individually introduces inefficiencies:
High Blockchain Transaction Costs
Each Write Marker submission incurs a gas fee, making frequent submissions expensive.
Increased Blockchain Load
Processing multiple individual transactions burdens the network, slowing down other operations.
Slower Processing & Payment Verification
Storing and validating each Write Marker separately delays payment settlements for blobbers.
To address these challenges, the Chained Write Marker Structure enables blobbers to aggregate multiple Write Markers into a single submission transaction, reducing overhead and improving efficiency.
Chain Hashing Mechanism
The Chained Write Marker Structure is based on cryptographic hashing to ensure the integrity of stored data while reducing the blockchain footprint.
1. Chaining Write Markers
Each Write Marker contains a Chain Hash, which is computed as:
Where:
Previous Chain Hash: The hash of the last committed Write Marker.
Allocation Root: The unique root hash representing the current allocation state.
Initial Condition: If no previous Write Marker exists (i.e., for the first marker in the chain), the Allocation Root alone is used.
2. Submission Process
The blobber accumulates up to 128 uncommitted Write Markers.
The latest Write Marker is submitted along with the allocation roots of all uncommitted markers.
The blockchain computes the chain hash using the stored previous marker and verifies the integrity of the entire chain.
Once verified, the new Write Marker is appended to the chain, making it an auditable, tamper-resistant record.
3. Cryptographic Verification
The Write Marker Signature Payload includes:
Chain Hash (to maintain link integrity).
Previous Chain Hash (to establish sequential proof).
Chain Size (ensuring proper aggregation).
Allocation Root (tracking the latest storage state).
Previous Allocation Root (for validation).
Client ID and Blobber ID (ensuring authenticity).
Timestamp (preventing replay attacks).
Allocation ID (linking to the correct storage allocation).
Write Marker Size (preventing data tampering).
File Meta Root (ensuring metadata integrity).
The blockchain and validators perform rigorous checks to validate:
The correctness of the chain hash using SHA-256.
The integrity of chain size to prevent tampering.
The validity of the user signature, ensuring the Write Marker is authentic.
If any inconsistency is detected (e.g., mismatched chain hash or incorrect chain size), the blobber's submission is rejected.
Chain Hash Calculation Code
Below is the implementation for computing the Chain Hash:
If a previous chain hash exists, it is included in the calculation. The new allocation root is hashed along with it. The resulting SHA-256 digest is returned as the new chain hash.
Process Flow Diagrams
1. Chaining Process
This sequence diagram represents how Write Markers are chained together.
Each Write Marker carries the previous chain hash. The chain size grows cumulatively, ensuring an ordered record. The final marker is submitted to the blockchain for validation.
2. Verification Process
This flow illustrates how blockchain validation ensures correctness.
The blobber submits the latest Write Marker Chain.
The Blockchain compute Chain hash and verify Chain size
If it is valid, the blockchain accepts and if it is invalid, the blockchain rejects.
The Chained Write Marker Protocol is a critical efficiency improvement in decentralized storage, ensuring faster, cheaper, and more secure Write Marker submissions.
By using chain hashing and batch processing, blobbers can optimize storage operations, improve payment turnaround times, and maintain data integrity on the blockchain.
Last updated