Skip to main content

πŸ”— Chainlink Oracle Integration

ReserveBTC uses a custom Chainlink External Adapter to relay off-chain Bitcoin reserve proofs into Ethereum smart contracts.

πŸ“‘ Role of the Oracle​

  • Acts as a bridge between BTC verification (off-chain) and mint/burn logic (on-chain).
  • Ensures the smart contract remains trustless and autonomous.
  • Pulls data from ReserveBTC backend and passes it to rBTC-SYNTH contract.

🧠 Oracle Responsibilities​

  • Monitor verified BTC addresses from ReserveBTC database.
  • Check balances via ElectrumX / Blockstream API every 20 seconds.
  • Compare historical balance with current balance.

πŸ” Trigger Events​

The Oracle triggers the following smart contract function:

function reportVerifiedBalance(address ethAddress, uint256 amountBtc) external onlyOracle {
// Mint or burn logic inside
}
  • Mint tokens if it’s the user’s first verified BTC deposit.
  • Add tokens if BTC amount increases.
  • Burn tokens if BTC is withdrawn.

πŸ› οΈ Infrastructure​

ComponentDescription
Chainlink External AdapterDocker-based API relay from backend to EVM
SupabaseStores form data and verification states
Node.js ScriptPeriodically checks BTC reserves
Chainlink Oracle NodeCalls reportVerifiedBalance()

βœ… Trust Model​

  • Oracle is whitelisted in the contract (onlyOracle modifier).
  • Cannot call mint/burn arbitrarily β€” relies on deterministic BTC state.
  • Oracle address is fixed and immutable.

πŸ› οΈ Next:​

Verified by code. Delivered by oracle. Powered by Bitcoin.