Data Availability
Sunrise Data Availability Layer is designed for high-throughput data availability, offering enhanced scalability and flexibility for applications. To achieve this, Sunrise adopts off-chain BLOB data and executes Erasure Coding for each Blob data, not entire block data.
The x/da module provides these features.
Key Features
Section titled “Key Features”Sunrise’s off‑chain DA design unlocks unmatched throughput and cost‑efficiency without sacrificing on‑chain security.
- Off-chain Erasure Encoding Dramatically cuts validator compute & storage: only a metadata URI pointing to these erasure-coded data shares on chain, full data reconstruction happens off‑chain.
- Off-chain Storage Integration Utilizing decentralized storage solutions such as IPFS and Arweave, data shards are stored externally. MsgPublishData includes only a metadata URI pointing to these erasure-coded data shares, reducing the on-chain block size requirements for blob transactions and enhancing scalability.
DA Comparison
Section titled “DA Comparison”| Sunrise | Avail DA | Celestia | EigenDA | Ethereum (EIP-4844) | |
|---|---|---|---|---|---|
| Architecture | L1 with off-chain blobs | L1 Blockchain | L1 Blockchain | DA Service | L1 Blockchain (blobs) |
| Throughput | 5+ MB/s | 0.2 MB/s (4MB/block) | 1.33 MB/s (8MB/block) | 15 MB/s | 0.064 MB/s |
| Time to Finality | ~4min (7s+240s) | 40 seconds | 6 sec + 10 min | 12 min | 12 min |
| Data Storage | Off-chain blobs | On-chain | On-chain | Committee storage | On-chain blobs |
| Proof Mechanism | Optimistic with off-chain storage | Validity proof (KZG) | Fraud proof | Validity proof | Validity proof |
| Long-term Retrievability | Seamless | Not native | Not native | Not native | Not native |
| Cost Model | Fee Abstraction via liquidity | Direct fees | Direct fees | Committee fees | On-chain gas fees |
| Consensus | Proof of Liquidity | Babe & Grandpa (NPoS) | Tendermint | N/A | Ghost & Casper |
Design Overview
Section titled “Design Overview”Design patterns of other DA layers
Section titled “Design patterns of other DA layers”-
Data Availability Committee
Data Availability Committee (DAC) is the traditional method to construct alternative Data Availability layer with low costs.
However, in DAC, it is impossible for clients to verify whether Data Availability attested by the committee is true or false, without downloading entire blob data.
-
Data Availability Sampling
In the Data Availability layers which adopts Data Availability Sampling (DAS), block data are processed for Erasure Coding. Then clients can verify the Data Availability only with downloading a part of block data, and can verify the inclusion of blob data in the block by using Merkle Tree structure.
In typical DAS setup, full nodes must transfer and download transaction data within the mempool.
As blob data sizes grow, the network’s throughput could be limited by these transaction transfers, creating challenges for applications handling large blob data.
Sunrise’s design
Section titled “Sunrise’s design”To address these problems in DAC and DAS, Sunrise implements the following solutions:
-
Off-chain Erasure Encoding Blob data is processed for Erasure Coding in off-chain program, to reduce validator load.
-
Blob data sharding Not the entire block data but each blob is processed for Erasure Coding. Clients still can verify the Data Availability for each blob only with repeating to download shards, without downloading entire data. Clients also can verify the inclusion of blob in the block by using Merkle Tree structure.
-
External Storage Blob data is stored on decentralized storage platforms like IPFS and Arweave. Rather than containing blob data on-chain, MsgPublishData holds a metadata URI pointing to erasure-coded data shares.
message MsgPublishData {option (cosmos.msg.v1.signer) = "sender";string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];string metadata_uri = 2;uint64 parity_shard_count = 3;repeated bytes shard_double_hashes = 4;string data_source_info = 5;}Data availability is attested with Optimistic way. If enough invalidity challenges is submitted to the Sunrise network, validators will submit Zero-Knowledge Proofs (ZKP) using double-hashed shard data (
shard_double_hashes), allowing validators to verify the presence of shard data without revealing it.
Proof Lifecycle
Section titled “Proof Lifecycle”Submitted data will have one of the following statuses:
-
Created → Challenge Period → Challenging → Verified / Rejected
-
Challenge Period: After submission, data remains in this status for a set period. If enough invalidity challenges are submitted, it moves to Challenging; otherwise, it becomes Verified.
-
Challenging: Validators verify the data and submit proofs. If the validated shard meets the criteria, it becomes Verified; if not, Rejected.
-
Verified: The metadata URI is included in the block and can be referenced externally.
-
Rejected: The data was determined to be invalid and is not included in the block.
graph TD
A[Created] --> B[Challenge Period]
B -->|No challenge| C[Verified]
B -->|Challenged| D[Challenging]
D -->|Valid| C
D -->|Invalid| E[Rejected]
Flow of proof
Section titled “Flow of proof”%%{init: {"theme": "default", "themeVariables": {
"background": "transparent",
"primaryColor": "#22223b",
"primaryTextColor": "#22223b",
"lineColor": "#22223b",
"textColor": "#22223b",
"actorBorder": "#22223b",
"actorTextColor": "#22223b",
"sequenceNumberColor": "#22223b",
"messageTextColor": "#22223b",
"signalColor": "#22223b"
}}}%%
sequenceDiagram
autonumber
User->>Publisher Node: blob data
Publisher Node->>Publisher Node: Erasure coding
Publisher Node->>Decentralized Storage: Upload data shards
Publisher Node->>Sunrise: MsgPublishData
User->>Sunrise: Fraud Challenge if needed
Sunrise->>Validator Set: Start Voting for Challenging
Validator Set->>Sunrise: Zero Knowledge Validity Proof
Zero-Knowledge Proof System
Section titled “Zero-Knowledge Proof System”Terms and Notation
Section titled “Terms and Notation”- The hash function:
- Set of validators:
- Set of data shards:
- Set of parity shards:
- Set of shards:
Overview
Section titled “Overview”This system verifies the possession of data shard hash without exposing The circuit is for one shard .
-
Public Inputs
-
Private Inputs
-
Circuit Constraints
The condition of Data Availability
Section titled “The condition of Data Availability”Notations
Section titled “Notations”- Replication Factor (Based only on data shards):
- Replication Factor (Based on including parity shards):
- The number of shards each validator is engaged in:
Requirements for each shard to prove Data Availability
Section titled “Requirements for each shard to prove Data Availability”- Set of valid proofs for a shard
sfrom validators engaged in this shard:
- Set of shards which satisfy this condition:
Requirements for tally to prove Data Availability
Section titled “Requirements for tally to prove Data Availability”Example parameters
Section titled “Example parameters”- 10 validators:
- 20 shards:
- 10 data shards
- 10 parity shards
- Each validator submits 6 shards proofs
Case A: valid shard s_1
Section titled “Case A: valid shard s_1”- Validator , and ‘s proof contain shard and other 5 shards
- Validator failed to contain the validity of shard in its proof
- However validator and succeeded to contain the validity of shard in its proof, then
- It satisfies
Case B: invalid shard s_2
Section titled “Case B: invalid shard s_2”- Validator , and ‘s proof contain shard and other 5 shards
- Validator and failed to contain the validity of shard in its proof
- Only validator succeeded to contain the validity of shard in its proof, then
- It doesn’t satisfy
Case X: shard s_1, s_3-s_11 are valid with the condition above
Section titled “Case X: shard s_1, s_3-s_11 are valid with the condition above”- It satisfies
Case Y: Only shard s_1, s_3 are valid with the condition above
Section titled “Case Y: Only shard s_1, s_3 are valid with the condition above”- It doesn’t satisfy
Parameters
Section titled “Parameters”| Param | Default | Units | Description |
|---|---|---|---|
| publish_data_gas | 1,000,000 | gas | Gas cost for publishing data |
| challenge_threshold | 0.33 | ratio | Threshold of invalidity challenges required to enter challenge period |
| replication_factor | 5.0 | copies | Number of data shard replicas |
| slash_epoch | 120,960 | blocks | Epoch period for slash judgment (approximately 1 week) |
| slash_fault_threshold | 0.5 | ratio | Threshold of invalid proofs that triggers validator slashing |
| slash_fraction | 0.001 | ratio | Voting power reduction rate during slashing |
| challenge_period | 4 minutes | time | Period for challenges after data published |
| proof_period | 10 minutes | time | Period for submitting proofs after challenge |
Messages
Section titled “Messages”The module provides various message types:
- MsgUpdateParams: Update module parameters (governance operation)
- MsgPublishData: Publish data with metadata URI and shard information
- MsgSubmitInvalidity: Report data invalidity for specific indices
- MsgSubmitValidityProof: Submit validity proof from a validator
- MsgRegisterProofDeputy: Register a proof deputy for a validator
- MsgUnregisterProofDeputy: Unregister a proof deputy
Queries
Section titled “Queries”The module provides various query endpoints:
- Params: Query module parameters
- PublishedData: Get details of published data for a specific metadata URI
- AllPublishedData: List all published data
- ValidityProof: Get validity proof from a specific validator
- AllValidityProofs: List all validity proofs for a specific metadata URI
- Invalidity: Get invalidity report for a specific metadata URI and sender
- AllInvalidity: List all invalidity reports for a specific metadata URI
- ValidatorShardIndices: Get shard indices for a specific validator
- ZkpProofThreshold: Get ZKP proof threshold for a specific number of shards
- ProofDeputy: Get proof deputy for a specific validator
See Github for details.