Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Short Form DAVerifier without blob extraction #1772

Closed
Tracked by #1784
eyusufatik opened this issue Jan 30, 2025 · 1 comment · Fixed by #1822
Closed
Tracked by #1784

New Short Form DAVerifier without blob extraction #1772

eyusufatik opened this issue Jan 30, 2025 · 1 comment · Fixed by #1822
Assignees
Milestone

Comments

@eyusufatik
Copy link
Member

eyusufatik commented Jan 30, 2025

Since the Batch proof commits to L1 hashes added to Citrea (see #1771), we must make sure in the batch proof that these hashes are correct.

Along with the block hash, the BitcoinLightClient contract is supplied with the merkle root of the wtxid's of bitcoin transactions. We'll also add depth of txid merkle proof for the coinbase transaction later on (issue to be created).

Making sure L1 hash is correct is easy, just supply headers, hash and check for equality.

To make sure wtxid root and coinbase txid merkle proof depth is correct, we'll have to supply a smaller version of our BitcoinDa InclusionProof for each L1 block added to the BitcoinLightClient contract, and verify it before allowing for the system transaction that will insert these L1 block information to the contract.

This way, the light client proof can be sure that the state transition extracted from a batch proof is valid.

This "short-form" proof struct will have 3 fields (name due change):

struct ShortFormProofDaInfo {
  header: Da::Header,
  coinbase_tx: BitcoinTransactionWrapper,
  coinbase_tx_tx_id_merkle_proof: Vec<_>,
  wtxid_commitment: [u8; 32],
}

It will implement a verify function aslo:

fn verify(&self) -> (Da::SlotHash, [u8; 32], u8) {
  // first verify coinbase tx inclusion with respect to header
  // extract wtxid commitment from coinbase tx assert it is equal to self.wtxid_commitment
  // return hash(header), wtxid commitment, len(coinbase_tx_tx_id_merkle_proof)
}
@eyusufatik
Copy link
Member Author

eyusufatik commented Feb 6, 2025

struct ShortFormProofDaInfo {
 header: Da::Header,
 coinbase_tx: BitcoinTransactionWrapper,
 coinbase_tx_tx_id_merkle_proof: Vec<_>,
 wtxid_commitment: [u8; 32],
}

since our Header already includes a txs_commitment, we don't need to put wtxid_commitment field in this struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant