Module citrea

Source
Expand description

Provides functions to build Bitcoin transactions related to commit-reveal pattern for Citrea rollup.

Modulesยง

data_serialization
reveal_scripts ๐Ÿ”’
This module contains functions to create transactions for the DA layer.
sync

Enumsยง

CitreaTxRequest
Citrea DA payload request.
TransactionKind
Type represents a typed enum for transaction kind Conversion to u16 (to_bytes) should be same as used in citrea repo. citrea/crates/bitcoin-da/src/helpers/mod.rs

Constantsยง

MAX_CHUNK_SIZE ๐Ÿ”’
Maximum raw BatchProof chunk size.

Functionsยง

build_commit_transaction ๐Ÿ”’
Build the commit part of commit-reveal pair Multiple commits can be in the same tx (if chunks are used, each commit needs a different nonce so that the addresses are different)
build_reveal_transaction ๐Ÿ”’
Build the reveal part of commit-reveal pair
calculate_sha256 ๐Ÿ”’
sign_blob_with_private_key
Signs a message with a private key Returns (signature, public_key)