SOST OTC / P2P — Trustless Cross-Chain Atomic Swaps V14 preview · gates still safety-closed · live target: block 15,000
TL;DR SOST is building a
truly non-custodial OTC / P2P board where two users can swap SOST for another cryptoasset
without trusting each other and
without SOST ever holding their funds. Either both legs of the swap settle, or both refund. There is no escrow operator, no admin key, no upgrade
path. The mechanism is the same primitive that powers the Lightning Network: a
Hashed Time-Locked Contract (HTLC) on both chains.
Seven supported asset pairs - SOST ↔ BTC — native, no issuer freeze
- SOST ↔ ETH — native, no issuer freeze
- SOST ↔ BNB — native, no issuer freeze
- SOST ↔ USDT — issuer-risk (Tether can freeze)
- SOST ↔ USDC — issuer-risk (Circle can freeze)
- SOST ↔ PAXG — issuer-risk (Paxos can freeze)
- SOST ↔ XAUT — issuer-risk (TG Commodities can freeze)
The issuer-risk label is surfaced explicitly in the wallet UI before every swap. Atomic-swap atomicity holds
on the SOST side regardless of any
issuer behaviour on the counterparty leg.
How it works — plain language Alice has SOST, wants BTC. Bob has BTC, wants SOST. They agree price and amounts on the OTC / P2P board. From that point on,
no intermediary touches
either coin:
[list=1]
- Alice locks her SOST in a SOST-side HTLC, redeemable by Bob with a secret only Alice knows (she just generated it). Refundable to Alice after
timeout T1. - Bob locks his BTC in a Bitcoin-side HTLC, redeemable by Alice using the same secret. Refundable to Bob after timeout T2 (T2 < T1 by a
safety margin enforced by the wallet). - Alice claims the BTC by revealing the secret on the Bitcoin chain.
- Bob reads the secret from the Bitcoin chain and uses it to claim the SOST.
End state:
- Happy path: both legs settle. Alice gets BTC, Bob gets SOST.
- One side stalls: timeouts fire. Each party recovers their own coin.
- Partial settlement: not reachable — the state machine on each chain enforces this without any external coordinator.
Four security pillars ⚙ Decentralised. No SOST Foundation custody. No broker. No centralised matching engine. The OTC / P2P board lets two parties find each other; the
swap itself is bilateral and cryptographic.
✓ Atomic. Either both legs complete or both refund. No partial settlement is reachable. The state machine on each chain enforces this without any
external coordinator.
🔒 Non-custodial. Neither SOST nor any third party ever holds the funds. The HTLC IS the escrow. There is
no owner, no admin, no pause switch,
no upgrade path, no emergency drain in either chain's contract.
🔍 Verifiable. Every step is a public on-chain transaction. Anyone running a SOST node + a Bitcoin / EVM node can replay the swap and verify that
the cryptographic conditions held.
No off-chain trust required.
Two technical paths BTC path Native Bitcoin HTLC using a BIP-199-style
P2WSH redeem script (SegWit v0). Signing delegated to
libwally-core (the Blockstream library used
in Liquid and Green wallet, continuously fuzzed via OSS-Fuzz since 2019). No Bitcoin script written from scratch by SOST. BIP-143 sighash, BIP-173 Bech32,
low-S signatures all delegated to the upstream-audited code path. The libwally submodule is pinned to release_1.5.3 (commit
000137393a436d55a18971ca93a2d20a54d55437), maintainer signature verified.
EVM path (ETH / BNB / ERC-20) Single 273-line Solidity contract
AtomicSwapHTLC.sol. No owner, no upgrade, no pause, no drain.
52 Foundry tests covering:
- Exact balance conservation (native + ERC-20)
- Reentrancy via malicious receiver and via malicious token
- Weird-ERC-20 behaviour (false-return, no-return, fee-on-transfer)
- EIP-6780 forced-ETH selfdestruct
- Claim / refund ordering and double-spend prevention
- Fuzz: wrong-preimage never claims (256 runs)
- Fuzz: refundTime boundary is sharp at the exact block (256 runs)
Issuer-risk notice (important, transparent) Atomic swap protects against counterparty theft in the swap itself. It cannot stop a token issuer from freezing addresses. The four issuers above (Tether, Circle, Paxos, TG Commodities) retain the legal ability to freeze any holder, including a HTLC contract's balance. If a
freeze fires mid-swap, the SOST side still refunds correctly — cryptographic atomicity on the SOST chain is unaffected — but the counterparty-chain side
may become uncollectible until the issuer unfreezes.
BTC, ETH and BNB pairs do not carry this issuer risk — they are native chain currencies with no freeze authority.
Current state of the gates (verifiable in repo) ATOMIC_SWAP_HTLC_ACTIVATION_HEIGHT = INT64_MAX — SOST consensus gate, sentinel OFF.
SOST_BTC_HTLC_SIGNING = OFF — CMake flag, no real BTC signing compiled in.
V14_HEIGHT = 15,000 — intended activation height (NOT yet active).
All atomic-swap wallet / RPC / CLI commands refuse
--sign --broadcast while the gate stays at
INT64_MAX.
Mainnet behaviour is
unchanged today.
What's done, what's pending ✓ Done - SOST-side consensus: LOCK / CLAIM / REFUND validation with adversarial tests
- Wallet helpers + RPC handlers + CLI commands (all gated)
- Coordinator state machine (pure local, no IO / no signing / no keys)
- EVM contract hardened: 52 Foundry tests all green
- End-to-end local simulation: 10 scenarios, 43 assertions PASS
- OTC / P2P wizard UI preview (every action button disabled)
- Pre-deploy operator checklist (15 items)
- libwally-core vendored and signature-verified (release_1.5.3)
⏳ Pending (in this order) [list=1]
- Wire libwally wally_* calls into the BTC signing backend (currently disabled stub)
- Turn the PENDING BIP-143 / BIP-173 test vectors into passing assertions
- Testnet harnesses: SOST ↔ BTC regtest, SOST ↔ ETH Sepolia, SOST ↔ ERC-20
- External cryptographic audit (BTC signing usage, Solidity contract, timeouts/economy)
- Coordinated V14 hard fork activation (flip both gates, operator + miner + wallet recompile)
Each step is its own commit on the
feat/atomic-swap-htlc-v13-candidate branch. Nothing ships to mainnet until ALL of the above are green AND
signed off by the external review.
Why this matters The OTC / P2P space is dominated by
custodial brokers (you send first, hope they send back),
escrow services (an operator can disappear with
the funds), and
centralised matching engines (single point of failure, single point of regulatory pressure). SOST's atomic swap removes all three
roles. Two strangers, two chains, one shared secret, two timeouts — or both walk away with their own coins. That is the entire surface of trust. No more,
no less.
Links Contact
SOST is an experimental native Proof-of-Work project in pre-market testing. Atomic swap is a planned V14 feature; nothing in this post
represents a guarantee of activation timing, listing, or value. All gates remain safety-closed at the time of writing. — NeoB[/list][/list]