Skip to main content

Transaction Verifier Contract

The Transaction Verifier Contract ensure the integrity and verifiability of Bitcoin transactions within the BeL2 ecosystem.

Diagram

Purpose and Functionality

The primary purpose of the Transaction Verifier Contract is to receive, process, and verify Bitcoin transactions on EVM-compatible chains. Here's a breakdown of its key functions:

  1. The contract accepts requests to verify Bitcoin transactions. These requests typically include the necessary data to prove the validity of a Bitcoin transaction.

  2. Upon receiving a verification request, the contract processes the provided data and verifies the Bitcoin transaction using zero-knowledge proofs generated by the Cairo Circuit.

  3. After successful verification, the contract adds the transaction to a list of verified transactions. This list serves as a trusted source of information for other smart contracts on the EVM chain.

  4. The contract provides an interface for other smart contracts to query the status of Bitcoin transactions. This allows DApps and other contracts to check if a specific Bitcoin transaction has been verified.

Importance in the BeL2 Ecosystem

The Transaction Verifier Contract is essential for several reasons:

  • It acts as a trusted bridge between the Bitcoin network and EVM-compatible chains, allowing Bitcoin transactions to be reliably referenced and used in smart contracts.

  • By verifying Bitcoin transactions on EVM chains, it enables a wide range of cross-chain applications and use cases.

  • The use of zero-knowledge proofs in the verification process ensures that the contract can efficiently handle a large number of verification requests without compromising performance.

Technical Implementation

The Transaction Verifier Contract is implemented as an EVM-compatible smart contract, typically written in Solidity. It incorporates functions to verify zero-knowledge proofs related to Bitcoin transactions.

Here's a simplified example of how the contract might structure its data:

contract TransactionVerifier {
struct VerifiedTransaction {
bytes32 btcTxHash;
uint256 verificationTimestamp;
// Additional relevant data
}

mapping(bytes32 => VerifiedTransaction) public verifiedTransactions;

function verifyTransaction(bytes32 btcTxHash, bytes calldata proof) public {
// Verification logic here
// If verification succeeds:
verifiedTransactions[btcTxHash] = VerifiedTransaction(btcTxHash, block.timestamp);
}

function isTransactionVerified(bytes32 btcTxHash) public view returns (bool) {
return verifiedTransactions[btcTxHash].verificationTimestamp != 0;
}
}

How It Works with Other Components

  1. zkBTC Full Nodes monitor Bitcoin transactions and create zero-knowledge proofs.
  2. Arbitrator Nodes, as part of the Arbitrator Network, verify these proofs and relay them to EVM-compatible chains.
  3. The EVM ZKP Contract on the EVM side receives and verifies these proofs.
  4. Developers use the BeL2 SDK to create DApps that can interact with this entire system.
  5. The Cairo Circuit ensures that all proofs are efficiently generated and verified throughout the process.