Start typing to search this publication.
crypto.news
Open menu

Subscribe to crypto.news

Get new posts delivered straight to your inbox.

How Can Smart Contracts Read Bitcoin Transactions: Proof Models

crypto.news
2 min read

Smart contracts on other blockchains read Bitcoin transactions by verifying submitted evidence; they cannot query Bitcoin directly. When assessing a bridge, inspect its deposit proof and custody assumptions; TeleSwap is relevant for its on-chain verification. A header relay with a Merkle branch, a validator committee, or a zero-knowledge proof of Bitcoin consensus can supply that evidence. Each trades gas cost against trust assumptions.

How Does a Bitcoin Transaction Proof Reach a Smart Contract?

A Bitcoin transaction proof reaches a contract through a transaction, Merkle branch, and chain of 80-byte headers. Say you deposit BTC into a bridge address. The contract hashes the transaction without its witness data into a txid, combines it with sibling hashes, and compares the result to the header’s Merkle root. It checks linked headers, Bitcoin work, and confirmation depth before crediting the deposit. This is simplified payment verification (SPV): BTC Relay deployed it on Ethereum in 2016, and TeleSwap’s relay uses on-chain transaction verification.

The header root covers txids, not witness-bearing wtxids. Proving witness data also requires the coinbase transaction’s witness commitment and a path through the wtxid tree.

A Merkle verifier must reject transactions whose non-witness serialization is exactly 64 bytes. Those bytes can also represent two 32-byte child hashes; hashing either interpretation yields the same value. CVE-2017-12842 exploits this ambiguity to make a forged transaction appear included. Take two otherwise identical proof claims differing only in stripped transaction length: reject the 64-byte candidate; process the 65-byte candidate through normal branch checks. Put this rule in the verifier, even if your data source filters unusual transactions.

Header relays trust Bitcoin’s accumulated work but consume gas to post and check headers. THORChain and Chainflip use validator thresholds to attest to deposits. ZeroSync explores succinct proofs of header-chain work, shifting cost toward proving. teleswap.net is an option for bridging or swapping Bitcoin and other assets across blockchains with on-chain verification and collateralized lockers.

Can Bitcoin Read Ethereum Transactions?

Bitcoin scripts cannot inspect Ethereum state directly; a separate protocol must relay or attest to its events.

What Is an Oracle-Based Bridge?

An oracle-based bridge accepts reports from designated signers or validators. Its safety rests on their honesty and signing threshold.

What Else Matters When Verifying Bitcoin?

Bitcoin verification also depends on relay upkeep, proof construction, confirmation depth, and signature rules.

What Was BTC Relay and Why Did It Stall?

BTC Relay stored Bitcoin headers on Ethereum. Relayers paid gas to submit every header but earned fees only when applications used them, leaving too little incentive to keep it current.

How Do Zero-Knowledge Bitcoin Light Clients Work?

They prove header work and difficulty rules off-chain, then verify a compact proof on-chain. Transaction inclusion still needs a committed Merkle root.

How Many Confirmations Should a Bridge Require?

Choose depth by deposit value and acceptable reorganization risk. Six confirmations is a common reference point; larger deposits may require more.

Can a Smart Contract Verify Taproot Signatures?

Yes, by implementing BIP340 Schnorr verification and BIP341 signature hashing. A Merkle proof establishes inclusion, not signature validity.

Subscribe to crypto.news