Protocol
sBridge

Flow & Primitives

Deposit, withdrawal, and trustless swap flows: protocol primitive reference

Deposit (External → SBChain)

User sends BTC to gateway external address
        ↓
Gateway confirms on Bitcoin chain
        ↓
Gateway issues BRIDGE.BTC IOU to user's SBChain account
        ↓
User trades BRIDGE.BTC on SBChain DEX

Withdrawal (SBChain → External)

User sends BRIDGE.BTC to gateway's SBChain account
        ↓
Gateway burns the IOU (asset_reserve_operation)
        ↓
Gateway releases BTC to user's Bitcoin address
        ↓
Transaction confirmed on Bitcoin chain

Trustless Swap (HTLC)

Both parties agree on terms off-chain
        ↓
Alice locks SBChain tokens in HTLC (htlc_create_operation)
        ↓
Bob locks BTC in Bitcoin HTLC using same hash
        ↓
Alice reveals preimage → claims Bob's BTC
        ↓
Bob uses revealed preimage → claims Alice's SBChain tokens
        ↓
Swap complete — no intermediary required

Protocol Primitives Summary

PrimitiveProtocol OperationPurpose
Gateway IOU tokenasset_create_operation + asset_issue_operationTokenise external assets on SBChain
HTLChtlc_create_operationTrustless atomic swap
Withdraw permissionwithdraw_permission_create_operationAutomated recurring gateway payments
Memo encryptionmemo_data on transfersEncrypted instructions to gateway (destination address, network, etc.)

Bridge Object IDs

ObjectID FormatDescription
HTLC1.16.xActive hash time locked contract
Withdraw Permission1.12.xActive withdrawal permission