📙

Bitcoin Bridge

Valid Headers

TeleportDAO's Bitcoin bridge contract validates the Proof-of-Work mechanism of Bitcoin. For every submitted block header the Relay contract verifies:
  1. 1.
    The block header refers correctly to a previously submitted header.
  2. 2.
    The header shows enough work has been done.
  3. 3.
    Re-targeting the difficulty has been done correctly.
  4. 4.
    Some other checks: the header hasn't been submitted before, the block number isn't too old, etc.
If a block header passes all checks, it is considered a valid block header. However, the valid header cannot be used for checking transaction inclusion since it may rewind from the main chain by future block headers.

Finalized Headers

Every time a valid block header is added, the Relay contract checks whether a previous block header gets finalized. To do so, Relay uses the longest chain rule of Bitcoin, i.e, a header is finalized if it is buried under six consecutive valid block headers. Users can provide Merkle inclusion proofs against the finalized headers. Also, the Relayers who submitted block headers that become finalized will get a reward.