Skip to content

Commit

Permalink
Chunked DA txs (#925)
Browse files Browse the repository at this point in the history
* Bitcoin DA versions

* Fix parser tests, review comments

* Init chunked txs

* Chain chunked parts with utxos

* Actually construct Type0/Type1 based on body size

* fix script for type 0

* Fix scripts with checksigverify

* Add vout index for prev tx (#961)

* Add vout index for prev tx

* replace prev_tx logic with prev_utxo logic

* remove RawUTXO

---------

Co-authored-by: eyusufatik <[email protected]>

* Esad/better inclusion proof (#991)

* depend only on wtxid

* verify merkle root of coinbase tx, use zkvm efficient sh256 and bitcoin merkle tree

* remove unused asserts

* pr fixes

* pr fixes

* Add batchproof/lightclient namespaces. Add SequencerCommitment tx type

* Apply #961 again

* Esad get_service

* Sign list of tx of aggregates tx instead of body (#1003)

* fix bitcoin da test suite (#1009)

* get ready for test fixes

* fix tests

* reactivate some of the verifier tests

* fix remaning bitcoin-da tests

* cleanup

* clippy

* Kpp/merkle tests (#1017)

* Add merkle tree tests (#995)

* Add merkle tree tests

* Add 1 tx test to bitcoin compare

---------

Co-authored-by: yaziciahmet <yaziciahmetcleargmail.com>

* Fix errors/lints

---------

Co-authored-by: Ahmet Yazıcı <[email protected]>

* Allow dead code

* Fix tx prefixes in guest-bitcoin

* Review fixes

* Review fix

* Revert test non_parseable_tx

* Rename parse_transaction -> parse_light_client_transaction

* fix confusion on BitcoinService::new (#1025)

---------

Co-authored-by: eyusufatik <[email protected]>
Co-authored-by: Erce Can Bektüre <[email protected]>
Co-authored-by: Esad Yusuf Atik <[email protected]>
Co-authored-by: Ahmet Yazıcı <[email protected]>
  • Loading branch information
5 people authored Aug 20, 2024
1 parent dcf4b3a commit 5dea363
Show file tree
Hide file tree
Showing 21 changed files with 2,553 additions and 1,013 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/citrea/provers/risc0/guest-bitcoin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions bin/citrea/provers/risc0/guest-bitcoin/src/bin/bitcoin_da.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]
use bitcoin_da::spec::RollupParams;
use bitcoin_da::verifier::BitcoinVerifier;
use citrea_primitives::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME};
use citrea_primitives::{REVEAL_BATCH_PROOF_PREFIX, REVEAL_LIGHT_CLIENT_PREFIX, ROLLUP_NAME};
use citrea_stf::runtime::Runtime;
use citrea_stf::StfVerifier;
#[cfg(feature = "bench")]
Expand Down Expand Up @@ -43,7 +43,8 @@ pub fn main() {
stf,
BitcoinVerifier::new(RollupParams {
rollup_name: ROLLUP_NAME.to_string(),
reveal_tx_id_prefix: DA_TX_ID_LEADING_ZEROS.to_vec(),
reveal_batch_prover_prefix: REVEAL_BATCH_PROOF_PREFIX.to_vec(),
reveal_light_client_prefix: REVEAL_LIGHT_CLIENT_PREFIX.to_vec(),
}),
);

Expand Down
10 changes: 6 additions & 4 deletions bin/citrea/src/rollup/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use async_trait::async_trait;
use bitcoin_da::service::{BitcoinService, DaServiceConfig, TxidWrapper};
use bitcoin_da::spec::{BitcoinSpec, RollupParams};
use bitcoin_da::verifier::BitcoinVerifier;
use citrea_primitives::{DA_TX_ID_LEADING_ZEROS, ROLLUP_NAME};
use citrea_primitives::{REVEAL_BATCH_PROOF_PREFIX, REVEAL_LIGHT_CLIENT_PREFIX, ROLLUP_NAME};
use citrea_prover::prover_service::ParallelProverService;
use citrea_risc0_bonsai_adapter::host::Risc0BonsaiHost;
use citrea_risc0_bonsai_adapter::Digest;
Expand Down Expand Up @@ -113,11 +113,12 @@ impl RollupBlueprint for BitcoinRollup {
let (tx, rx) = unbounded_channel::<SenderWithNotifier<TxidWrapper>>();

let service = Arc::new(
BitcoinService::new(
BitcoinService::new_with_wallet_check(
rollup_config.da.clone(),
RollupParams {
rollup_name: ROLLUP_NAME.to_string(),
reveal_tx_id_prefix: DA_TX_ID_LEADING_ZEROS.to_vec(),
reveal_light_client_prefix: REVEAL_LIGHT_CLIENT_PREFIX.to_vec(),
reveal_batch_prover_prefix: REVEAL_BATCH_PROOF_PREFIX.to_vec(),
},
tx,
)
Expand Down Expand Up @@ -148,7 +149,8 @@ impl RollupBlueprint for BitcoinRollup {

let da_verifier = BitcoinVerifier::new(RollupParams {
rollup_name: ROLLUP_NAME.to_string(),
reveal_tx_id_prefix: DA_TX_ID_LEADING_ZEROS.to_vec(),
reveal_light_client_prefix: REVEAL_LIGHT_CLIENT_PREFIX.to_vec(),
reveal_batch_prover_prefix: REVEAL_BATCH_PROOF_PREFIX.to_vec(),
});

ParallelProverService::new_with_default_workers(
Expand Down
2 changes: 1 addition & 1 deletion crates/bitcoin-da/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ homepage = { workspace = true }
license = "MIT OR Apache-2.0"
publish = false
repository = { workspace = true }
rust-version = "1.66"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -30,6 +29,7 @@ tracing = { workspace = true, optional = true }
bitcoin = { workspace = true }
brotli = { workspace = true }
futures.workspace = true
sha2 = { workspace = true }

bitcoincore-rpc = { workspace = true, optional = true }

Expand Down
Loading

0 comments on commit 5dea363

Please sign in to comment.