Skip to main content

Finality Gadget

Finality gadget is a daemon program that keeps tallying all finality signatures for L2 blocks and serves RPC to allow querying the BTC-voting quorum of those blocks.

  • It connects to a Babylon node for querying the voting power of finality providers.
  • It connects to the finality contract via the Babylon node for querying finality signatures.
  • It connects to an RPC of the OP stack chain to get L2 block metadata.

Upon a new L2 block in the OP-stack chain, It:

  • Queries the finality contract to get all finality signatures over this L2 block.
  • Queries Babylon to get all finality providers’ BTC delegations for this chain and use the L2 block’s timestamp to determine the voting power distribution among all its finality providers at the time of this block.
  • Tallies finality signatures and determine whether the L2 block receives a quorum.
  • If this L2 block receives a quorum and its parent block is also BTC staking-finalized, mark it BTC staking-finalized and store it in the finality gadget’s local database.