Skip to content

Commit e251e39

Browse files
rach-idjcstein
andauthored
docs: combine Blobstream and Blobstream X docs (celestiaorg#1379)
* docs: initial attempt to integrate BlobstreamX docs * Update nodes/hardfork-process.md * feat: rearrange menu and remove old workflow * docs: add snippets to proofs queries * chore: blobstream -> blobstreamx * chore: contract -> library * chore: contract -> library * chore: tabs * docs: add proofs queries overview * chore: remove unnecessary note * docs: add listening for new events docs * feat: add initial blobstream x intro section + linting + formatting * feat: add overview of blobstream x section * feat: wrap up edits to blobstream.md page for blobstream x * feat: edits to blobstream.md * feat: add local blobstream x instructions * docs: address code review changes * Update developers/blobstreamx-offchain.md by @Gunter038 * docs:some feedback by @puma314 * feat: add proof language * feat: update requesting-data-commitment-ranges intro * feat: feedback for description on requesting-data-commitment-ranges.md page * feat: use sections for datacommittment ranges page * feat: split blobstreamxdeploy page into sections * feat: upgrade diagrams * Apply suggestions from code review * feat: upgrade contracts with placeholders * feat: remove page and link to succint docs * feat: add docs.succint.xyz in place of succint.xyz * feat: add testnet on table * feat: resolve todos * feat: add links to mocha/mainnet * feat: add blobstream header for clarity * feat: put intro in menu bc top level link of menu is weird * feat: styling updates and graphics update * feat: add page back for blobstream-x deploy * docs: Apply suggestions from code review Co-authored-by: CHAMI Rachid <[email protected]> * Apply suggestions from code review Co-authored-by: CHAMI Rachid <[email protected]> * feat: feedback from comment on GH * feat: update file paths and config.ts * Update developers/blobstream.md * Apply suggestions from code review * Apply suggestions from code review --------- Co-authored-by: joshcs.eth ᵍᵐ <[email protected]> Co-authored-by: Josh Stein <[email protected]>
1 parent 37907c4 commit e251e39

17 files changed

+1101
-1413
lines changed

.vitepress/config.ts

+18-28
Original file line numberDiff line numberDiff line change
@@ -411,33 +411,6 @@ function sidebarHome() {
411411
],
412412
},
413413
{ text: "Consensus", link: "/nodes/consensus-node" },
414-
{
415-
text: "Blobstream for validators",
416-
collapsed: true,
417-
items: [
418-
{
419-
text: "Install the binary",
420-
link: "/nodes/blobstream-binary",
421-
},
422-
{
423-
text: "Blobstream Orchestrator",
424-
link: "/nodes/blobstream-orchestrator",
425-
},
426-
{ text: "Key management", link: "/nodes/blobstream-keys" },
427-
{
428-
text: "Blobstream Relayer",
429-
link: "/nodes/blobstream-relayer",
430-
},
431-
{
432-
text: "Deploy the contract",
433-
link: "/nodes/blobstream-deploy",
434-
},
435-
{
436-
text: "Blobstream Bootstrapper",
437-
link: "/nodes/blobstream-bootstrapper",
438-
},
439-
],
440-
},
441414
{
442415
text: "IBC relayers",
443416
collapsed: true,
@@ -553,9 +526,12 @@ function sidebarHome() {
553526
},
554527
{
555528
text: "Integrate with Blobstream",
556-
link: "/developers/blobstream",
557529
collapsed: true,
558530
items: [
531+
{
532+
text: "Overview of Blobstream",
533+
link: "/developers/blobstream",
534+
},
559535
{
560536
text: "Integrate with Blobstream contracts",
561537
link: "/developers/blobstream-contracts",
@@ -568,6 +544,20 @@ function sidebarHome() {
568544
text: "Querying the Blobstream proofs",
569545
link: "/developers/blobstream-proof-queries",
570546
},
547+
{
548+
text: "Local Blobstream X operators",
549+
collapsed: true,
550+
items: [
551+
{
552+
text: "Requesting data commitment ranges",
553+
link: "/developers/requesting-data-commitment-ranges",
554+
},
555+
{
556+
text: "Non-canonical Blobstream X deployments",
557+
link: "/developers/blobstream-x-deploy",
558+
},
559+
],
560+
},
571561
],
572562
},
573563
{

developers/blobstream-contracts.md

+29-25
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ Make sure to have the following installed:
1313

1414
- [Foundry](https://github.com/foundry-rs/foundry)
1515

16-
### Installing Blobstream contracts
16+
### Installing Blobstream X contracts
1717

18-
Install the Blobstream contracts repo as a dependency:
18+
We will be using the Blobstream X implementation of
19+
Blobstream, so we can install its repo as a dependency:
20+
21+
Install the Blobstream X contracts repo as a dependency:
1922

2023
```sh
21-
forge install celestiaorg/blobstream-contracts --no-commit
24+
forge install TBD --no-commit
2225
```
2326

2427
Note that the minimum Solidity compiler version for using the Blobstream
@@ -27,38 +30,39 @@ contracts is `0.8.19`.
2730
### Example usage
2831

2932
Example minimal Solidity contract for a stub ZK rollup that leverages the
30-
Blobstream contract to check that data has been posted to Celestia:
33+
`BlobstreamX.sol` contract to check that data has been posted to Celestia:
3134

3235
```solidity
3336
// SPDX-License-Identifier: Apache-2.0
3437
pragma solidity ^0.8.19;
3538
39+
TBD
3640
import "blobstream-contracts/IDAOracle.sol";
3741
import "blobstream-contracts/DataRootTuple.sol";
3842
import "blobstream-contracts/lib/tree/binary/BinaryMerkleProof.sol";
3943
4044
contract MyRollup {
41-
IDAOracle immutable blobstream;
45+
IDAOracle immutable blobstreamX;
4246
bytes32[] public rollup_block_hashes;
4347
44-
constructor(IDAOracle _blobstream) {
45-
blobstream = _blobstream;
48+
constructor(IDAOracle _blobstreamX) {
49+
blobstreamX = _blobstreamX;
4650
}
4751
4852
function submitRollupBlock(
4953
bytes32 _rollup_block_hash,
5054
bytes calldata _zk_proof,
51-
uint256 _blobstream_nonce,
55+
uint256 _blobstreamX_nonce,
5256
DataRootTuple calldata _tuple,
5357
BinaryMerkleProof calldata _proof
5458
) public {
5559
// Verify that the data root tuple (analog. block header) has been
5660
// attested to by the Blobstream contract.
5761
require(
58-
blobstream.verifyAttestation(_blobstream_nonce, _tuple, _proof)
62+
blobstreamX.verifyAttestation(_blobstreamX_nonce, _tuple, _proof)
5963
);
6064
61-
// Verify the ZKP.
65+
// Verify the ZKP (zero-knowledge proof).
6266
// _tuple.dataRoot is a public input, leaves (shares) are private inputs.
6367
require(verifyZKP(_rollup_block_hash, _zk_proof, _tuple.dataRoot));
6468
@@ -93,18 +97,18 @@ verifying a Merkle inclusion proof.
9397

9498
The [`IDAOracle`](https://github.com/celestiaorg/blobstream-contracts/blob/master/src/IDAOracle.sol)
9599
(**D**ata **A**vailability **O**racle Interface) interface allows L2 contracts
96-
on Ethereum to query the Blobstream contract for relayed `DataRootTuple`s. The
97-
single interface method `verifyAttestation` verifies a Merkle inclusion proof
98-
that a `DataRootTuple` is included under a specific batch (indexed by batch
99-
nonce). In other words, analogously it verifies that a specific block header is
100-
included in the canonical Celestia chain.
100+
on Ethereum to query the `BlobstreamX.sol` contract for relayed `DataRootTuple`s.
101+
The single interface method `verifyAttestation` verifies a Merkle inclusion
102+
proof that a `DataRootTuple` is included under a specific batch (indexed by
103+
batch nonce). In other words, analogously it verifies that a specific block
104+
header is included in the canonical Celestia chain.
101105

102106
## Querying the proof
103107

104108
To prove that the data was published to Celestia, check out the
105-
[proof queries documentation](./blobstream-proof-queries.md)
109+
[proof queries documentation](./blobstreamx-proof-queries.md)
106110
to understand how to query the proofs from Celestia consensus
107-
nodes and make them usable in the Blobstream verifier contract.
111+
nodes and make them usable in the Blobstream X verifier contract.
108112

109113
## Verifying data inclusion for fraud proofs
110114

@@ -119,27 +123,27 @@ against a `DataRootTuple`. The library is stateless, and allows to pass an
119123

120124
In the `DAVerifier` library, we find functions that help
121125
with data inclusion verification and calculating the square size of a
122-
Celestia block. These functions work with the Blobstream smart contract,
126+
Celestia block. These functions work with the Blobstream X smart contract,
123127
using different proofs to check and confirm the data's availability. Let's
124128
take a closer look at these functions:
125129

126130
- [`verifySharesToDataRootTupleRoot`](https://github.com/celestiaorg/blobstream-contracts/blob/3a552d8f7bfbed1f3175933260e6e440915d2da4/src/lib/verifier/DAVerifier.sol#L80-L124):
127131
This function verifies that the
128-
shares, which were posted to Celestia, were committed to by the Blobstream
132+
shares, which were posted to Celestia, were committed to by the Blobstream X
129133
smart contract. It checks that the data root was committed to by the
130-
Blobstream smart contract and that the shares were committed to by the
134+
Blobstream X smart contract and that the shares were committed to by the
131135
rows roots.
132136
- [`verifyRowRootToDataRootTupleRoot`](https://github.com/celestiaorg/blobstream-contracts/blob/3a552d8f7bfbed1f3175933260e6e440915d2da4/src/lib/verifier/DAVerifier.sol#L133-L155):
133137
This function verifies that a
134138
row/column root, from a Celestia block, was committed to by the
135-
Blobstream smart contract. It checks that the data root was committed
136-
to by the Blobstream smart contract and that the row root commits to
139+
Blobstream X smart contract. It checks that the data root was committed
140+
to by the Blobstream X smart contract and that the row root commits to
137141
the data root.
138142
- [`verifyMultiRowRootsToDataRootTupleRoot`](https://github.com/celestiaorg/blobstream-contracts/blob/3a552d8f7bfbed1f3175933260e6e440915d2da4/src/lib/verifier/DAVerifier.sol#L164-L194):
139143
This function verifies
140144
that a set of rows/columns, from a Celestia block, were committed
141-
to by the Blobstream smart contract. It checks that the data root was
142-
committed to by the Blobstream smart contract and that the rows roots
145+
to by the Blobstream X smart contract. It checks that the data root was
146+
committed to by the Blobstream X smart contract and that the rows roots
143147
commit to the data root.
144148
- [`computeSquareSizeFromRowProof`](https://github.com/celestiaorg/blobstream-contracts/blob/3a552d8f7bfbed1f3175933260e6e440915d2da4/src/lib/verifier/DAVerifier.sol#L204-L215):
145149
This function computes the Celestia
@@ -155,4 +159,4 @@ take a closer look at these functions:
155159
`verifySharesToDataRootTupleRoot()` method.
156160

157161
For an overview of a demo rollup implementation, head to
158-
[the next section](./blobstream-offchain.md).
162+
[the next section](./blobstreamx-offchain.md).

developers/blobstream-offchain.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ description: Learn how to integrate your L2's offchain logic with Blobstream
66

77
## Blobstream demo rollup
88

9-
Rollups can use the Blobstream for DA by posting their data to Celestia and then
9+
Rollups can use Blobstream for DA by posting their data to Celestia and then
1010
proving that it was posted on Ethereum. This is done identically to how any
11-
rollup or user would post data to Celestia, and then the validators sign over
12-
additional commitments that are relayed to Ethereum via a light client relay
13-
(aka Blobstream!). This demo will outline (note outline is not an
11+
rollup or user would post data to Celestia. Then, a zero-knowledge proof that
12+
Celestia validators have come to consensus on Celestia block headers is
13+
generated, and subsequently relayed to Ethereum to the Blobstream X smart
14+
contract.
15+
16+
This demo rollup will outline (the outline is not an
1417
implementation! please do not expect to copy and paste this code 🙂) a very
1518
simple Blobstream rollup to illustrate at a high level what this could look
1619
like.

0 commit comments

Comments
 (0)