Skip to main content
Under the Hood

Inside the BuiId Protocol

Chain adapters, HTLC contracts, and a settlement coordinator stack together in layers. Nothing in that stack ever takes custody, so funds stay in participant wallets right up until the atomic swap finishes.

System Outline

Layers and How They Talk

Chain-specific logic lives apart from settlement coordination, which means a new chain slots in without disturbing the core HTLC engine.

Settlement Coordinator state machine Bitcoin Adapter CLTV / P2SH HTLC EVM Adapter Solidity HTLC contract Solana Adapter Rust program HTLC HTLC Engine hash preimage gen timeout mgmt refund logic event watching
The Parts

What Each Layer Handles

Chain Adapters

Every supported chain gets its own adapter, fluent in that chain's HTLC dialect: Bitcoin Script CLTV, EVM Solidity contracts, or Solana Rust programs. Because adapters stay isolated, adding a new chain leaves the settlement layer untouched.

Settlement Coordinator

This piece drives the swap state machine, carrying each trade from negotiation to lock confirmation, preimage reveal, and final claim. It keeps watch on both chains, spots the transactions that matter, and applies the timeout rules that shield both sides.

HTLC Engine

Here the cryptographic parameters are generated: the hash preimage, the timeout durations, and the refund conditions behind each contract. The engine also runs the reveal sequence and checks the preimage before telling the coordinator to move ahead.

Chain Reference

Chains, Locks, and Confirmation Counts

Chain HTLC Mechanism Typical Settlement Confirmations Required Status
Bitcoin OP_CHECKLOCKTIMEVERIFY 30-60 min 3 Live
Ethereum Solidity contract 5-15 min 12 Live
Litecoin OP_CHECKLOCKTIMEVERIFY 10-20 min 6 Live
Dogecoin OP_CHECKLOCKTIMEVERIFY 5-10 min 6 Live
Solana Rust on-chain program 1-3 min 32 slots Live
Polygon (MATIC) Solidity contract 1-3 min 64 Live

Bring the Protocol Into Your Stack

The SDK hides chain-specific detail behind one interface. Begin in the testnet environment and promote to production without leaving the session.