BitcoinHeaderRelay Singleton NFT ID below, verify every on-chain invariant (confirmed, unspent, matching R7 & R9) before paying cash, and never reuse one Bitcoin address across concurrent orders.
Standalone, zero-dependency P2P onramp desk from fiat cash to native Bitcoin secured by Ergo L1 collateral
(rsBTC, unfreezable USE, SigUSD, or any Ergo native token) and verified via Ergo's native on-chain BitcoinHeaderRelay — zero price oracle, zero bridge guards, zero custodian.
Works live on GitHub Pages or opened locally from disk.
state 0/1): —state 2): —
Queries Explorer via short 64-hex ergoTreeTemplateHash (paginated, filtered client-side to your exact Relay NFT) or Ergo Node indexed endpoints.
state 0), pending cash wires (state 1), and locked collateral bonds (state 2) for your configured BitcoinHeaderRelay NFT.
CashToBtcOnrampOffer)No offers loaded yet.
CashToBtcOnrampLock)No locked bonds loaded yet.
CashToBtcOnrampLock box before handing over fiat cash.
The verifier binds BOTH your Ergo payout hash (R9) AND your cooperative-release signing key (R7, blocking rogue-2c theft), enforces your chosen maximum fallback wait, checks no concurrent lock reuses your Bitcoin address, and requires a live synced Relay.
state = 1 still relies on Seller signing 1a SellerConfirmCash; timeout 1b returns your Ergo bond and Seller's tokens, not off-chain wires.
Fetches fresh on-chain state (spend status, confirmation height, live Relay tip, active locks) and verifies all 11 invariants. Fails closed if ANY required field is blank.
0b · State 0 → 1)
Verifies the target box is unspent and matches the exact compiled CashToBtcOnrampOffer ErgoTree for your Relay NFT before requesting a Nautilus signature. Pins minBtcHeight = relayTip + 1 via dataInputs(0).
Connect Nautilus to build and sign 0b BuyerTakeOffer (verifies exact Offer ErgoTree & fresh height).
2b · 0 B Proof!)
If no BTC SPV proof settles before btcDeadline (HEIGHT ≥ btcDeadline), claim 100% of rsBTC or USE collateral directly to your Ergo address.
Works even with a brand-new 0.000 ERG wallet and NO Nautilus extension (deducts canonical 0.0011 ERG miner fee from the lock box ERG buffer, lossless BigInt JSON, proofBytes = 0 B!).
Ready for permissionless 0-ERG non-delivery claim once live Ergo HEIGHT >= btcDeadline.
2c) & Pending Unwind / Timeout (1b)
Coop Instant Release (2c): Received your BTC and want to release Seller's collateral early? Sign with Nautilus (proveDlog(buyerPk)).
Unwind / No-Cash Timeout (1b): Unwind an expired (0 B permissionless!) or cancelled PENDING_CASH box — returns 100% tokens to Seller + 100% buyerBondNano to Buyer.
Enter target boxId and matching Seller/Buyer addresses.
Connect Seller's Nautilus wallet to lock rsBTC / USE collateral (enforces exact contract bounds & live Relay NFT).
1a) or Cancel Untaken (0a)Paste an offer boxId from the Order Book to confirm fiat cash arrival (1a) or cancel (0a).
2a · 0 B Proof!)
Reconstructs the live BitcoinHeaderRelay AVL+ tree from its on-chain history, verifies bit-for-bit equality against the live Relay box R8 digest, checks relayTip ≥ H + minConfs - 1 and canonical stripped-tx bounds (1..16 ins/outs, depth ≤ 16, ≠ 64 B), and broadcasts a 0 B proof self-funded unlock!
Paste lockBoxId + confirmed Bitcoin Mainnet txid. Note: payment tx MUST have 1..16 inputs, 1..16 outputs, and ≠ 64 stripped bytes.
| Layer | Exact Property & Honest Scope |
|---|---|
| Ergo L1 Consensus (Proven) | Once in state = 2 (CashToBtcOnrampLock), Seller cannot unlock collateral without proving native BTC delivery (≥ minSats, exact R4, ≥ minConfs, btcHeight ≥ minBtcHeight, paired CVE-2017-12842 coinbase depth, exact 2016-block Bitcoin retarget) before btcDeadline — otherwise Buyer claims 100% of rsBTC / USE at HEIGHT ≥ btcDeadline with 0 ERG & 0 oracle. |
| Mode 1 (Direct Cash Desk) | Attended / face-to-face cash exchange. Buyer verifies state 2 (unspent, confirmed, matching R7 & R9) before paying cash. Seller has operational exposure only during the handoff window between locking state 2 and receiving cash. |
| Mode 2 (Remote P2P Wire) | Buyer deposits refundable Ergo anti-grief bond (0 → 1). Returning 100% of the bond on timeout (1b) removes bond-theft extortion, but off-chain bank wires cannot be verified by L1 — Mode 2 still requires Seller reputation/trust to sign 1a SellerConfirmCash after receiving fiat. |
| Settlement & BTC Tx Bounds | btcDeadline measures Ergo SPV proof settlement (disjoint: 2a: HEIGHT < btcDeadline; 2b: HEIGHT ≥ btcDeadline). Operational cutoff: broadcast BTC at least max(24, minConfs×6 + 12) Ergo blocks before btcDeadline, using a standard BTC tx with 1..16 inputs, 1..16 outputs, and ≠ 64 stripped bytes. |
| Address Uniqueness | minBtcHeight ≥ relayTip + 1 blocks historical replay, and the UI checks active locks for duplicate destinations — always use a fresh unique BTC address per order! |
| Relay Reorg Scope | BitcoinHeaderRelay verifies exact Bitcoin Core 2016-block retargets (tested on Mainnet #32,256) and authenticates 6..10 overlapping MTP timestamps against SELF.R6 on reorgs. Single-tx reorg is bounded to forks up to 5 blocks deep within the active 2016-block difficulty epoch; deeper or cross-epoch reorgs are outside this reference relay's single-tx scope. |
#671,615 Proofs| Asset / Contract | Exact On-Chain Reference & Audit Status |
|---|---|
rsBTC (Mainnet) | 7a51950e5f548549ec1aa63ffdc38279505b11e7e803d01bcf8347e0123c88b0 (Rosen Bridge, dec = 8; subject to Rosen bridge peg/redemption assumptions) |
USE (Mainnet) | a55b8735ed1a99e46c2c89f8994aacdf4b1109bdcf682f1e5b34479c6e392669 (DexyUSD, dec = 3; 110–130% reduces moderate BTC-move default risk, does not eliminate extreme tail moves) |
SigUSD (Mainnet) | 03faf2cb329f2e90d6d23b58d91bbb6c046aa143261cc21f52fbe2824bfcbf04 (SigmaUSD V2, dec = 2; 110–130% recommended; subject to AgeUSD reserve-ratio & peg dynamics) |
BitcoinHeaderRelay | Tree 3,439 B · Worst box 3,693 B / 4,096 B · 0 ERROR · Exact retarget #32,256 + SELF.R6 reorg MTP auth + future-time upper bound |
CashToBtcOnrampLock | Tree 3,104 B · Worst box 3,437 B / 4,096 B · 0 ERROR · INPUTS(0).id == SELF.id |
CashToBtcOnrampOffer | Tree 1,396 B · Worst box 1,736 B / 4,096 B · 0 ERROR, 0 WARNING · Disjoint 1a/1b |
#671,615 (Real BTC Mainnet SegWit #977,926 bc1q0y356c… · 0.11705478 BTC · Merkle Depth 7!):
#977,928): 8c075db677a2c4f46a4852026a76d66bf9f108f7ca04ae16cac71445056f056f0b BuyerTakeOffer (+0.05 tERG bond, minBtcH=977,926, cost=1,267): d90c2553…08a6 ↗1a SellerConfirmCash (locks 1,000.000 t-USE + refunds 0.05 tERG bond, cost=975): 992c1e04…1059 ↗#977,926..#977,928 (cost=3,760, 0 B proof): c72d4766…ae9c ↗2a SPV Unlock (cost=3,541, 0 B proof, Seller recovers 1,000.000 t-USE): b3164005…6e45 ↗2b 0.000 ERG Buyer Fallback (cost=1,791, 0 B proof, 0-ERG wallet receives 1.00000000 t-rsBTC, 0 oracle!): 301fe567…05de ↗ergo-6.1.3 attacks rejected HTTP 400: t-USE token-stripping (2a), early fallback (2b), wrong vout=1 (2a).