diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 5eb08ecc6e4..4ec435abd9c 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -717,45 +717,85 @@ function sidebarHome() { link: "/developers/blobstream-proof-queries", }, { - text: "Example implementation of Blobstream proofs by CryptoKass", - link: "https://github.com/CryptoKass/blobstreamx-example", - }, - { - text: "Local Blobstream X operators", + text: "SP1 Blobstream", collapsed: true, items: [ { - text: "Requesting data commitment ranges", - link: "/developers/blobstream-x-requesting-data-commitment-ranges", + text: "Local SP1 Blobstream operators", + collapsed: true, + items: [ + { + text: "New SP1 Blobstream deployments", + link: "/developers/sp1-blobstream-deploy", + }, + ], }, { - text: "New Blobstream X deployments", - link: "/developers/blobstream-x-deploy", + text: "SP1 Blobstream audits", + collapsed: true, + items: [ + { + text: "Ottersec", + link: "https://docs.celestia.org/audits/SP1_Blobstream_Ottersec_Audit.pdf", + }, + { + text: "SP1 Audits", + link: "https://github.com/succinctlabs/sp1/tree/dev/audits" + } + ] }, - ], + ] }, { - text: "Blobstream X audits", + text: "Blobstream X", collapsed: true, items: [ { - text: "Informal Systems", - link: "https://docs.celestia.org/audits/Blobstream_X-Informal_Systems_Audit.pdf", + text: "Overview of BlobstreamX", + link: "/developers/blobstreamx", }, { - text: "OtterSec", - link: "https://docs.celestia.org/audits/Blobstream_X-OtterSec_Audit.pdf", + text: "Example implementation of Blobstream proofs by CryptoKass", + link: "https://github.com/CryptoKass/blobstreamx-example", }, { - text: "Veridise", - link: "https://docs.celestia.org/audits/Blobstream_X-Veridise_Audit.pdf", + text: "Local Blobstream X operators", + collapsed: true, + items: [ + { + text: "Requesting data commitment ranges", + link: "/developers/blobstream-x-requesting-data-commitment-ranges", + }, + { + text: "New Blobstream X deployments", + link: "/developers/blobstream-x-deploy", + } + ] }, { - text: "Zellic", - link: "https://docs.celestia.org/audits/Blobstream_X-Zellic_Audit.pdf", + text: "Blobstream X audits", + collapsed: true, + items: [ + { + text: "Informal Systems", + link: "https://docs.celestia.org/audits/Blobstream_X-Informal_Systems_Audit.pdf", + }, + { + text: "OtterSec", + link: "https://docs.celestia.org/audits/Blobstream_X-OtterSec_Audit.pdf", + }, + { + text: "Veridise", + link: "https://docs.celestia.org/audits/Blobstream_X-Veridise_Audit.pdf", + }, + { + text: "Zellic", + link: "https://docs.celestia.org/audits/Blobstream_X-Zellic_Audit.pdf", + } + ], } - ], - } + ] + }, ], }, { diff --git a/developers/blobstream-contracts.md b/developers/blobstream-contracts.md index 4c5efc3438e..a10f40f62e6 100644 --- a/developers/blobstream-contracts.md +++ b/developers/blobstream-contracts.md @@ -1,6 +1,9 @@ --- sidebar_label: Integrate with Blobstream contracts description: Learn how to integrate your L2's onchain logic with Blobstream +prev: + text: "New SP1 Blobstream deployments" + link: "/developers/sp1-blobstream-deploy" --- # Integrate with Blobstream contracts @@ -13,15 +16,14 @@ Make sure to have the following installed: - [Foundry](https://github.com/foundry-rs/foundry) -### Installing Blobstream X contracts +### Installing Blobstream contracts -We will be using the Blobstream X implementation of -Blobstream, so we can install its repo as a dependency: - -Install the Blobstream X contracts repo as a dependency: +We will be using the [`IDAOracle`](https://github.com/celestiaorg/blobstream-contracts/blob/master/src/IDAOracle.sol) +interface to verify inclusion. +So, we will install the Blobstream contracts repo as a dependency: ```sh -forge install succinctlabs/blobstreamx --no-commit +forge install celestiaorg/blobstream-contracts --no-commit ``` Make sure that the directory you're running this command @@ -44,30 +46,29 @@ Example minimal Solidity contract for a stub ZK rollup that leverages the // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; -TBD import "blobstream-contracts/IDAOracle.sol"; import "blobstream-contracts/DataRootTuple.sol"; import "blobstream-contracts/lib/tree/binary/BinaryMerkleProof.sol"; contract MyRollup { - IDAOracle immutable blobstreamX; + IDAOracle immutable blobstream; bytes32[] public rollup_block_hashes; - constructor(IDAOracle _blobstreamX) { - blobstreamX = _blobstreamX; + constructor(IDAOracle _blobstream) { + blobstream = _blobstream; } function submitRollupBlock( bytes32 _rollup_block_hash, bytes calldata _zk_proof, - uint256 _blobstreamX_nonce, + uint256 _blobstream_nonce, DataRootTuple calldata _tuple, BinaryMerkleProof calldata _proof ) public { // Verify that the data root tuple (analog. block header) has been // attested to by the Blobstream contract. require( - blobstreamX.verifyAttestation(_blobstreamX_nonce, _tuple, _proof) + blobstream.verifyAttestation(_blobstream_nonce, _tuple, _proof) ); // Verify the ZKP (zero-knowledge proof). diff --git a/developers/blobstream-offchain.md b/developers/blobstream-offchain.md index 07652ad0962..35acd0ea87d 100644 --- a/developers/blobstream-offchain.md +++ b/developers/blobstream-offchain.md @@ -10,7 +10,7 @@ Rollups can use Blobstream for DA by posting their data to Celestia and then proving that it was posted on Ethereum. This is done identically to how any rollup or user would post data to Celestia. Then, a zero-knowledge proof that Celestia validators have come to consensus on Celestia block headers is -generated, and subsequently relayed to Ethereum to the Blobstream X smart +generated, and subsequently relayed to Ethereum to the Blobstream smart contract. This demo rollup will outline (the outline is not an diff --git a/developers/blobstream-proof-queries.md b/developers/blobstream-proof-queries.md index c5724a92df0..bc8a478e409 100644 --- a/developers/blobstream-proof-queries.md +++ b/developers/blobstream-proof-queries.md @@ -2,7 +2,7 @@ description: Learn how to query the inclusion proofs used in Blobstream next: text: "Requesting data commitment ranges" - link: "/developers/requesting-data-commitment-ranges" + link: "/developers/blobstream-x-requesting-data-commitment-ranges" --- # Blobstream proofs queries @@ -41,8 +41,21 @@ Celestia mainnet beta, and [mocha](../nodes/mocha-testnet.md) for the Mocha test In case the reader wants to interact with an on-chain contract that can be used to verify that data was posted to Celestia, the bindings of that contract are needed. -For Blobstream, the golang bindings can be found in the [Blobstream X](https://github.com/succinctlabs/blobstreamx/blob/main/bindings/BlobstreamX.go) -repository. For other languages, the corresponding smart contract bindings should +For Blobstream, the golang bindings can be found in the following links: + +::: code-group + +```text [BlobstreamX] +https://github.com/succinctlabs/blobstreamx/blob/main/bindings/BlobstreamX.go +``` + +```text [SP1 Blobstream] +https://github.com/succinctlabs/sp1-blobstream/blob/main/bindings/SP1Blobstream.go +``` + +::: + +For other languages, the corresponding smart contract bindings should be generated. Refer to [abigen](https://geth.ethereum.org/docs/tools/abigen) for more information. @@ -79,10 +92,8 @@ portion of the specs. ![Blobstream Commitment Diagram](/img/blobstream/blobstream-commitment-diagram.png) So to prove inclusion of a share to a Celestia block, we use Blobstream -as a source of truth. Currently, we will be using the Blobstream X implementation -of Blobstream, more information on Blobstream X can be found in -[the overview](./blobstream.md#blobstream-x). In a nutshell, Blobstream X -attests to the data posted to Celestia in the Blobstream X contract via +as a source of truth. In a nutshell, Blobstream +attests to the data posted to Celestia in the zk-Blobstream contract via verifying a zk-proof of the headers of a batch of Celestia blocks. Then, it keeps reference of that batch of blocks using the merkleized commitment of their `(dataRoot, height)` resulting in a `data root tuple root`. @@ -102,12 +113,17 @@ Check the above diagram which shows: - 3: in order to batch multiple blocks into the same commitment, we create a commitment over the `(dataRoot, height)` tuple for a batch of blocks, which results in a data root tuple root. It's this commitment that gets - stored in the Blobstream X smart contract. + stored in the Blobstream smart contract. + +So, if we're able to prove: -So, if we're able to prove that a share is part of a row, then that row is -committed to by a data root. Then, prove that that data root along with its +- That a share is part of a row, then that row is +committed to by a data root. +- Then, prove that that data root along with its height is committed to by the data root tuple root, which gets saved to the -Blobstream X contract, we can be sure that that share was committed to in +Blobstream contract. + +We can be sure that that share was committed to in the corresponding Celestia block. In this document, we will provide details on how to query the above proofs, @@ -144,7 +160,7 @@ Also, make sure to update the versions to match the latest ### 1. Data root inclusion proof -To prove the data root is committed to by the Blobstream X smart +To prove the data root is committed to by the Blobstream smart contract, we will need to provide a Merkle proof of the data root tuple to a data root tuple root. This can be created using the [`data_root_inclusion_proof`](https://github.com/celestiaorg/celestia-core/blob/c3ab251659f6fe0f36d10e0dbd14c29a78a85352/rpc/client/http/http.go#L492-L511) @@ -154,7 +170,7 @@ This [endpoint](https://github.com/celestiaorg/celestia-core/blob/793ece9bbd732a allows querying a data root to data root tuple root proof. It takes a block `height`, a starting block, and an end block, then it generates the binary Merkle proof of the `DataRootTuple`, corresponding to that `height`, -to the `DataRootTupleRoot` which is committed to in the Blobstream X contract. +to the `DataRootTupleRoot` which is committed to in the Blobstream contract. #### HTTP query @@ -232,11 +248,13 @@ func main() { -### Full example of proving that a Celestia block was committed to by Blobstream X contract +### Full example of proving that a Celestia block was committed to by Blobstream contract
-```go +::: code-group + +```go [BlobstreamX] package main import ( @@ -364,7 +382,7 @@ func verify() error { fmt.Println("data root was not committed to by the BlobstreamX contract") return nil } - return nil + return nil } func VerifyDataRootInclusion( @@ -402,6 +420,14 @@ func VerifyDataRootInclusion( return valid, nil } ``` + +```go [SP1 Blobstream] +// Similar to Blobstream, except replace the BlobstreamX contract with SP1 Blobstream: +import { + sp1blobstreamwrapper "github.com/succinctlabs/sp1-blobstream/bindings" +} +``` +:::
@@ -715,12 +741,12 @@ struct SharesProof { NamespaceNode[] rowRoots; // The proofs of the rowRoots to the data root. BinaryMerkleProof[] rowProofs; - // The proof of the data root tuple to the data root tuple root that was posted to the BlobstreamX contract. + // The proof of the data root tuple to the data root tuple root that was posted to the Blobstream contract. AttestationProof attestationProof; } /// @notice Contains the necessary parameters needed to verify that a data root tuple -/// was committed to, by the BlobstreamX smart contract, at some specif nonce. +/// was committed to, by the Blobstream smart contract, at some specif nonce. struct AttestationProof { // the attestation nonce that commits to the data root tuple. uint256 tupleRootNonce; @@ -1001,11 +1027,11 @@ with `proofs` being `sharesProof.RowProof.Proofs`. ### `attestationProof` This is the proof of the data root to the data root tuple root, which is committed -to in the Blobstream X contract: +to in the Blobstream contract: ```solidity /// @notice Contains the necessary parameters needed to verify that a data root tuple -/// was committed to, by the BlobstreamX smart contract, at some specif nonce. +/// was committed to, by the Blobstream smart contract, at some specif nonce. struct AttestationProof { // the attestation nonce that commits to the data root tuple. uint256 tupleRootNonce; @@ -1016,7 +1042,7 @@ struct AttestationProof { } ``` -- `tupleRootNonce`: the nonce at which Blobstream X committed to the batch containing +- `tupleRootNonce`: the nonce at which Blobstream committed to the batch containing the block containing the data. - `tuple`: the `DataRootTuple` of the block: @@ -1081,7 +1107,7 @@ func toAttestationProof( ``` -With the `nonce` being the attestation nonce, which can be retrieved using `BlobstreamX` +With the `nonce` being the attestation nonce, which can be retrieved using `Blobstream` contract events. Check below for an example. And `height` being the Celestia Block height that contains the rollup data, along with the `blockDataRoot` being the data root of the block height. Finally, `dataRootInclusionProof` is the @@ -1094,9 +1120,9 @@ If the `dataRoot` or the `tupleRootNonce` is unknown during the verification: (`15` in this example endpoint), and taking the `data_hash` field from the response. - `tupleRootNonce`: can be retried via querying the - `BlobstreamXDataCommitmentStored` events from the BlobstreamX + data commitment stored events from the Blobstream contract and looking for the nonce attesting to the - corresponding data. An example: + corresponding data. ### Querying the proof's `tupleRootNonce` @@ -1104,7 +1130,8 @@ If the `dataRoot` or the `tupleRootNonce` is unknown during the verification:
-```go +::: code-group +```go [BlobstreamX] // get the nonce corresponding to the block height that contains the PayForBlob transaction // since BlobstreamX emits events when new batches are submitted, we will query the events // and look for the range committing to the blob @@ -1164,16 +1191,28 @@ If the `dataRoot` or the `tupleRootNonce` is unknown during the verification: return fmt.Errorf("couldn't find range containing the block height") } ``` + +```go [SP1 Blobstream] +// Similar to BlobstreamX, but instead of importing the BlobstreamX contract, +// import the SP1 Blobstream contract: +import { + sp1blobstreamwrapper "github.com/succinctlabs/sp1-blobstream/bindings" +} +// and use the `BlobstreamDataCommitmentStored` event instead. +``` +:::
### Listening for new data commitments -For listening for new `BlobstreamXDataCommitmentStored` events, sequencers can +For listening for new data commitment stored events, sequencers can use the `WatchDataCommitmentStored` as follows:
-```go +::: code-group + +```go [BlobstreamX] ethClient, err := ethclient.Dial("evm_rpc") if err != nil { return err @@ -1211,6 +1250,17 @@ use the `WatchDataCommitmentStored` as follows: } } ``` + +```go [SP1 Blobstream] +// Similar to BlobstreamX, but instead of importing the BlobstreamX contract, +// import the SP1 Blobstream contract: +import { + sp1blobstreamwrapper "github.com/succinctlabs/sp1-blobstream/bindings" +} +// and use the `BlobstreamDataCommitmentStored` event instead. +``` + +:::
@@ -1254,7 +1304,9 @@ Then, you can submit the fraud proof using golang as follows:
-```go +::: code-group + +```go [BlobstreamX] package main import ( @@ -1489,12 +1541,24 @@ func namespace(namespaceID []byte) *client.Namespace { } } ``` + +```go [SP1 Blobstream] +// Similar to BlobstreamX, but instead of importing the BlobstreamX contract, +// import the SP1 Blobstream contract: +import { + sp1blobstreamwrapper "github.com/succinctlabs/sp1-blobstream/bindings" +} +// and use the `BlobstreamDataCommitmentStored` event instead. +``` + +::: +
For the step (2), check the [rollup inclusion proofs documentation](https://github.com/celestiaorg/blobstream-contracts/blob/master/docs/inclusion-proofs.md) for more information. -For an example project that uses the above proof queries, checkout the +For an example BlobstreamX project that uses the above proof queries, checkout the [blobstreamx-example](https://github.com/CryptoKass/blobstreamx-example) sample project. diff --git a/developers/blobstream.md b/developers/blobstream.md index 8cec66bf0a2..4e5b0fbbc0d 100644 --- a/developers/blobstream.md +++ b/developers/blobstream.md @@ -24,9 +24,18 @@ validity of Celestia block headers on a target EVM chain using zero-knowledge (Z proofs, which allow inheriting all the security guarantees of Celestia. +The latest implementation of Blobstream X is [SP1 Blobstream](https://github.com/succinctlabs/sp1-blobstream), +which is written in Rust for the SP1 zkVM. SP1 Blobstream offers improved performance and +efficiency while maintaining the security guarantees of the original Blobstream X. + Please note: Blobstream remains early-stage, experimental software and users should use Blobstream at their own risk. +### Implementations of Blobstream + +* [SP1 Blobstream](#what-is-sp1-blobstream) (an implementation of Blobstream X) +* [Blobstream X](#what-is-blobstream-x) + ## Blobstream vs. data availability committees (DACs) ### Decentralization and security @@ -57,9 +66,12 @@ In summary, both Blobstream and DACs aim to ensure offchain data availability, but Blobstream offers a more decentralized, secure, and scalable solution compared to the potential centralized nature of DACs. -## What is Blobstream X? +## What is SP1 Blobstream? -Blobstream X is an implementation of Blobstream with a +[SP1 Blobstream](https://github.com/succinctlabs/sp1-blobstream) is the latest implementation of Blobstream +in Rust using the [SP1](https://github.com/succinctlabs/sp1) zkVM. + +[SP1 Blobstream](https://github.com/succinctlabs/sp1-blobstream) is the latest implementation of Blobstream with a ZK light client that bridges Celestia’s modular DA layer to Ethereum to allow high-throughput rollups to use Celestia’s DA while settling on Ethereum. @@ -72,81 +84,51 @@ the Celestia network. Bridging Celestia’s data root to Ethereum requires running a Celestia _light client_ as a smart contract on Ethereum, to make the latest state -of the Celestia chain known on Ethereum and available to rollups. Blobstream -X utilizes the latest advances in ZK proofs to generate a +of the Celestia chain known on Ethereum and available to rollups. SP1 Blobstream +uses the latest advances in ZK proofs to generate a _succinct proof_ that enough Celestia validators have come to consensus (according to the CometBFT consensus protocol) on a block header, and -verifies this proof in the Blobstream X Ethereum smart contract to update +verifies this proof in the SP1 Blobstream Ethereum smart contract to update it with the latest Celestia header. -The Blobstream X ZK proof not only verifies the consensus of +The SP1 Blobstream ZK proof not only verifies the consensus of Celestia validators, but it also merkelizes and hashes all the data roots in the block range from the previous update to the current update, making accessible all Celestia data roots (verifiable with a Merkle inclusion proof against the stored Merkle root) to rollups. -Blobstream X is built and deployed with -[Succinct's protocol](https://platform-docs.succinct.xyz). +If you're looking to deploy SP1 blobstream to a new chain, +see [new Sp1 Blobstream deployments](./sp1-blobstream-deploy.md). + +Learn more at the [sp1-blobstream](https://github.com/succinctlabs/sp1-blobstream) +repo. -![blobstream x draft diagram](/img/blobstream/Celestia_Blobstream_X1b.png) +:::tip NOTE +The current Blobstream deployments all use SP1 Blobstream. +::: -## Integrate with Blobstream X +## Integrate with SP1 Blobstream -The following docs go over how developers can integrate Blobstream X. +The following docs go over how developers can integrate SP1 Blobstream. -You can [find the repository for Blobstream X](https://github.com/succinctlabs/blobstreamx) +You can [find the repository for SP1 Blobstream](https://github.com/succinctlabs/sp1-blobstream) along with code for: -- [The Blobstream X smart contract - `BlobstreamX.sol`](https://github.com/succinctlabs/blobstreamx/blob/main/contracts/src/BlobstreamX.sol) -- [The Blobstream X circuits](https://alpha.succinct.xyz/celestia/blobstreamx) -- [The Blobstream X contract Golang bindings](https://github.com/succinctlabs/blobstreamx/blob/main/bindings/BlobstreamX.go) +- [The SP1 Blobstream smart contract - `SP1Blobstream.sol`](https://github.com/succinctlabs/sp1-blobstream/blob/main/contracts/src/SP1Blobstream.sol) +- [The SP1 program](https://github.com/succinctlabs/sp1-blobstream/tree/main/program) +- [The SP1 Blobstream contract Golang bindings](//TODO) -The first deployments of Blobstream X will be maintained on the +The first deployments of SP1 Blobstream will be maintained on the following chains: Arbitrum One, Base and Ethereum Mainnet. Every 1 -hour, the prover/relayer will post an update to the Blobstream X contract +hour, the prover/relayer will post an update to the Blobstream contract that will include a new data commitment range that covers a 1-hour -block range from the `latestBlock` in the Blobstream X contract. -On Ethereum Mainnet, the Blobstream X contract will be updated +block range from the `latestBlock` in the contract. +On Ethereum Mainnet, the contract will be updated every 4 hours. -:::tip NOTE -Custom ranges can be requested using the `BlobstreamX` contract -to create proofs for specific Celestia block batches. These ranges -can be constructed as `[latestBlock, customTargetBlock)`, with -`latestBlock` as the latest block height that was committed to by the -`BlobstreamX` contract, and `latestBlock > customTargetBlock`, -and `customTargetBlock - latestBlock <= DATA_COMMITMENT_MAX`. - -Block ranges that are before the contract's `latestBlock` can't be -proven a second time in different batches. - -More information can be found in the [`requestHeaderRange(...)`](https://github.com/succinctlabs/blobstreamx/blob/364d3dc8c8dc9fd44b6f9f049cfb18479e56cec4/contracts/src/BlobstreamX.sol#L78-L101) -method. -::: - -### How Blobstream X works - -As shown in the diagram below, the entrypoint for updates to the Blobstream -X contract is through the `SuccinctGateway` smart contract, which is a -simple entrypoint contract that verifies proofs (against a deployed -onchain verifier for the Blobstream X circuit) and then calls the -`BlobstreamX.sol` contract to update it. -[Find more information about the `SuccinctGateway`](https://platform-docs.succinct.xyz/platform/onchain-integration#succinct-gateway). - -![blobstream x overview diagram draft](/img/blobstream/Celestia_Blobstream_X2b.png) +### How to integrate with Blobstream - - -:::tip NOTE -If the Blobstream X contract is not deployed on a desired chain, -it needs to be deployed before it can be used by your rollup. See the -[deployment documentation](https://platform-docs.succinct.xyz/platform/onchain-integration#non-canonical-chain-contract-deployment) -for more details. -::: - -### How to integrate with Blobstream X - -Integrating your L2 with Blobstream X requires two components: your +Integrating your L2 with Blobstream requires two components: your [onchain smart contract logic](./blobstream-contracts.md), and your [offchain client logic for your rollup](./blobstream-offchain.md). The next three sections cover these @@ -163,31 +145,17 @@ More on the different ways to build a blobstream rollup can be found in the ### Deployed contracts -You can interact with the Blobstream X contracts today. The -Blobstream X Solidity smart contracts are currently deployed on +You can interact with the SP1 Blobstream contracts today. The +SP1 Blobstream Solidity smart contracts are currently deployed on the following chains: -::: warning -Blobstream X is in beta and slashing is not enabled yet. -::: - -| Contract | EVM network | Contract address | Attested data on Celestia | Link to Celenium | -| ------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------- | -| Blobstream X | Ethereum Mainnet | [`0x7Cf3876F681Dbb6EdA8f6FfC45D66B996Df08fAe`](https://etherscan.io/address/0x7Cf3876F681Dbb6EdA8f6FfC45D66B996Df08fAe#events) | [Mainnet Beta](../nodes/mainnet.md) | [Deployment on Celenium](https://celenium.io/blobstream?network=ethereum&page=1) | -| Blobstream X | Arbitrum One | [`0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794`](https://arbiscan.io/address/0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794#events) | [Mainnet Beta](../nodes/mainnet.md) | [Deployment on Celenium](https://celenium.io/blobstream?network=arbitrum&page=1) | -| Blobstream X | Base | [`0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794`](https://basescan.org/address/0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794#events) | [Mainnet Beta](../nodes/mainnet.md) | [Deployment on Celenium](https://celenium.io/blobstream?network=base&page=1) | -| Blobstream X | Sepolia | [`0xf0c6429ebab2e7dc6e05dafb61128be21f13cb1e`](https://sepolia.etherscan.io/address/0xf0c6429ebab2e7dc6e05dafb61128be21f13cb1e#events) | [Mocha testnet](../nodes/mocha-testnet.md) | [Deployment on Celenium](https://mocha-4.celenium.io/blobstream?network=ethereum&page=1) | -| Blobstream X | Arbitrum Sepolia | [`0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2`](https://sepolia.arbiscan.io/address/0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2#events) | [Mocha testnet](../nodes/mocha-testnet.md) | [Deployment on Celenium](https://mocha-4.celenium.io/blobstream?network=arbitrum&page=1) | -| Blobstream X | Base Sepolia | [`0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2`](https://sepolia.basescan.org/address/0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2#events) | [Mocha testnet](../nodes/mocha-testnet.md) | [Deployment on Celenium](https://mocha-4.celenium.io/blobstream?network=base&page=1) | - -## Deploy Blobstream X - -If your target chain is [still not supported](#deployed-contracts), it is possible to deploy and maintain a Blobstream x instance and have the same security guarantees. - -First, you will need to create a multisig that governs the Blobstream X contract and also the function identifiers. The function identifiers can be registered in the [Succinct gateway](https://platform-docs.succinct.xyz/platform/onchain-integration#register-circuits-with-your-deployed-succinct-gateway). - -Then, check the [deployment](https://github.com/succinctlabs/blobstreamx/blob/main/README.md#blobstreamx-contract-overview) documentation for how to deploy the contract. - -Then, you will need to run a relayer, which will generate the proofs and relay them to your deployed Blobstream X contract. Check the [local proving documentation](./blobstream-x-requesting-data-commitment-ranges.md#local-proving) for more information. +| Contract | EVM network | Contract address | Attested data on Celestia | Link to Celenium | +|----------------| ---------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------- | +| SP1 Blobstream | Ethereum Mainnet | [`0x7Cf3876F681Dbb6EdA8f6FfC45D66B996Df08fAe`](https://etherscan.io/address/0x7Cf3876F681Dbb6EdA8f6FfC45D66B996Df08fAe#events) | [Mainnet Beta](../nodes/mainnet.md) | [Deployment on Celenium](https://celenium.io/blobstream?network=ethereum&page=1) | +| SP1 Blobstream | Arbitrum One | [`0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794`](https://arbiscan.io/address/0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794#events) | [Mainnet Beta](../nodes/mainnet.md) | [Deployment on Celenium](https://celenium.io/blobstream?network=arbitrum&page=1) | +| SP1 Blobstream | Base | [`0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794`](https://basescan.org/address/0xA83ca7775Bc2889825BcDeDfFa5b758cf69e8794#events) | [Mainnet Beta](../nodes/mainnet.md) | [Deployment on Celenium](https://celenium.io/blobstream?network=base&page=1) | +| SP1 Blobstream | Sepolia | [`0xf0c6429ebab2e7dc6e05dafb61128be21f13cb1e`](https://sepolia.etherscan.io/address/0xf0c6429ebab2e7dc6e05dafb61128be21f13cb1e#events) | [Mocha testnet](../nodes/mocha-testnet.md) | [Deployment on Celenium](https://mocha-4.celenium.io/blobstream?network=ethereum&page=1) | +| SP1 Blobstream | Arbitrum Sepolia | [`0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2`](https://sepolia.arbiscan.io/address/0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2#events) | [Mocha testnet](../nodes/mocha-testnet.md) | [Deployment on Celenium](https://mocha-4.celenium.io/blobstream?network=arbitrum&page=1) | +| SP1 Blobstream | Base Sepolia | [`0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2`](https://sepolia.basescan.org/address/0xc3e209eb245Fd59c8586777b499d6A665DF3ABD2#events) | [Mocha testnet](../nodes/mocha-testnet.md) | [Deployment on Celenium](https://mocha-4.celenium.io/blobstream?network=base&page=1) | diff --git a/developers/blobstreamx.md b/developers/blobstreamx.md new file mode 100644 index 00000000000..44afe00cab6 --- /dev/null +++ b/developers/blobstreamx.md @@ -0,0 +1,72 @@ +--- +description: What is BlobstreamX +--- + +# BlobstreamX: the previous zk implementation of Blobstream + +![blobstream x draft diagram](/img/blobstream/Celestia_Blobstream_X1b.png) + +## What is Blobstream X? + +Blobstream X is the previous implementation of Blobstream. It uses +[plonky2x](https://github.com/succinctlabs/succinctx/tree/main/plonky2x) to create +circuits that verify the Celestia consensus and generate the corresponding proofs. + +Blobstream X is built and deployed with +[Succinct's protocol](https://platform-docs.succinct.xyz). + +:::tip NOTE +The Blobstream deployments below don't use the BlobstreamX circuits. +::: + +You can [find the repository for Blobstream X](https://github.com/succinctlabs/blobstreamx) +along with code for: + +- [The Blobstream X smart contract - `BlobstreamX.sol`](https://github.com/succinctlabs/blobstreamx/blob/main/contracts/src/BlobstreamX.sol) +- [The Blobstream X circuits](https://alpha.succinct.xyz/celestia/blobstreamx) +- [The Blobstream X contract Golang bindings](https://github.com/succinctlabs/blobstreamx/blob/main/bindings/BlobstreamX.go) + +:::tip NOTE +Custom ranges can be requested using the `BlobstreamX` contract +to create proofs for specific Celestia block batches. These ranges +can be constructed as `[latestBlock, customTargetBlock)`, with +`latestBlock` as the latest block height that was committed to by the +`BlobstreamX` contract, and `latestBlock > customTargetBlock`, +and `customTargetBlock - latestBlock <= DATA_COMMITMENT_MAX`. + +Block ranges that are before the contract's `latestBlock` can't be +proven a second time in different batches. + +More information can be found in the [`requestHeaderRange(...)`](https://github.com/succinctlabs/blobstreamx/blob/364d3dc8c8dc9fd44b6f9f049cfb18479e56cec4/contracts/src/BlobstreamX.sol#L78-L101) +method. +::: + +## How Blobstream X works + +As shown in the diagram below, the entrypoint for updates to the Blobstream +X contract is through the `SuccinctGateway` smart contract, which is a +simple entrypoint contract that verifies proofs (against a deployed +onchain verifier for the Blobstream X circuit) and then calls the +`BlobstreamX.sol` contract to update it. +[Find more information about the `SuccinctGateway`](https://platform-docs.succinct.xyz/platform/onchain-integration#succinct-gateway). + +![blobstream x overview diagram draft](/img/blobstream/Celestia_Blobstream_X2b.png) + + + +:::tip NOTE +If the Blobstream X contract is not deployed on a desired chain, +it needs to be deployed before it can be used by your rollup. See the +[deployment documentation](https://platform-docs.succinct.xyz/platform/onchain-integration#non-canonical-chain-contract-deployment) +for more details. +::: + +## Deploy Blobstream X + +It is possible to deploy and maintain a Blobstream x instance and have the same security guarantees. + +First, you will need to create a multisig that governs the Blobstream X contract and also the function identifiers. The function identifiers can be registered in the [Succinct gateway](https://platform-docs.succinct.xyz/platform/onchain-integration#register-circuits-with-your-deployed-succinct-gateway). + +Then, check the [deployment](https://github.com/succinctlabs/blobstreamx/blob/main/README.md#blobstreamx-contract-overview) documentation for how to deploy the contract. + +Then, you will need to run a relayer, which will generate the proofs and relay them to your deployed Blobstream X contract. Check the [local proving documentation](./blobstream-x-requesting-data-commitment-ranges.md#local-proving) for more information. diff --git a/developers/sp1-blobstream-deploy.md b/developers/sp1-blobstream-deploy.md new file mode 100644 index 00000000000..9df08b87634 --- /dev/null +++ b/developers/sp1-blobstream-deploy.md @@ -0,0 +1,40 @@ +--- +next: + text: "Integrate with Blobstream X contracts" + link: "/developers/blobstream-contracts" +--- + +# New SP1 Blobstream deployments + +This document provides instructions for deploying SP1 Blobstream to a new chain. + +[SP1 Blobstream](https://github.com/succinctlabs/sp1-blobstream) is the latest implementation of Blobstream +in Rust using the [SP1](https://github.com/succinctlabs/sp1) zkVM. + +## Deploying the contracts + +To deploy SP1 Blobstream to a new chain, follow these steps: + +1. Clone the sp1-blobstream repository: + +```shell +git clone https://github.com/succinctlabs/sp1-blobstream +cd sp1-blobstream +``` + +2. Follow the deployment instructions in the +[sp1-blobstream README](https://github.com/succinctlabs/sp1-blobstream?tab=readme-ov-file#deployment). + +3. If you're deploying on a chain where there isn't a canonical verifier listed in the +[SP1 contract addresses](https://github.com/succinctlabs/sp1/blob/main/book/onchain-verification/contract-addresses.md), you'll need to: + + a. Deploy your own SP1 Verifier from the [sp1-contracts](https://github.com/succinctlabs/sp1-contracts) matching your `sp1-sdk` version. + b. Set the `SP1_VERIFIER_ADDRESS` in your `.env` file to the address of your deployed verifier. + +4. To run the prover: + + - For local proving, set `SP1_PROVER=local` in your environment. + - To use the Succinct Proving Network for remote proving, set `SP1_PROVER=network`. + - We recommend an instance with 64 vCPU and 128GB of RAM for local proving. + +Note: Any whitelisting for custom provers would need to be implemented in the application's smart contracts (e.g., by using an approvedProvers mapping). diff --git a/public/audits/SP1_Blobstream_Ottersec_Audit.pdf b/public/audits/SP1_Blobstream_Ottersec_Audit.pdf new file mode 100644 index 00000000000..9b7a36ed952 Binary files /dev/null and b/public/audits/SP1_Blobstream_Ottersec_Audit.pdf differ