GOLD DEX & PoPC

SOST DEX
& PoPC Contracts

Decentralized exchange for tokenized gold (XAUT, PAXG) with bilateral escrow settlement, ED25519 message signing, and Proof of Personal Custody contract specifications. On-chain gold backing meets trustless peer-to-peer trading.

How It Works — Simple

SOST lets you hold positions backed by tokenized gold, trade them with signed private messages, and settle automatically.

1. You deposit tokenized gold (XAUT or PAXG) into an immutable escrow contract on Ethereum. No admin key on deposits — the immutable settlementOperator can update beneficiary for position transfers, but cannot withdraw funds. Only the current beneficiary can withdraw after the lock period.

2. The system registers a native SOST position with its own ID, owner, reward schedule, and expiry date. That position is now a tradeable asset inside the SOST ecosystem.

3. You can sell the entire position to someone else for SOST. You get immediate liquidity without waiting for the lock to expire.

4. Or you can sell just the reward right — keep the gold-backed principal, monetize only the future yield.

5. Trades happen through signed and end-to-end encrypted messages (ED25519 signatures + X25519 key agreement + ChaCha20-Poly1305 AEAD). Every message — offer, accept, cancel, settlement notice — has a hash, a signature, a nonce, and an expiry. No forgery. No replay. No middleman.

6. The settlement engine verifies everything automatically: valid signatures, correct owner, no double-spend, no expired offers. Then it executes the transfer and records the complete audit trail.

Example — Angel sells a position to Pedro

Angel has a Model B position: 0.5 oz of XAUT locked for 28 days, with a future reward of 2,000 SOST units. The position is valued at ~9.7 SOST.

Angel needs liquidity now. Pedro is willing to wait.

Step 1: Angel creates a signed offer: “I sell position 8afed8fc for 9.7 SOST.” The offer is signed with Angel’s ED25519 key, includes a unique nonce and expires in 1 hour.

Step 2: Pedro receives the offer through the private relay channel. He verifies the signature is valid, checks the position exists, and accepts: “I buy position 8afed8fc for 9.7 SOST.” Also signed.

Step 3: The system derives a unique deal_id from both signatures and creates the deal.

Step 4: The settlement engine verifies: Angel is the real owner, the position is active, signatures are valid, no replay. Everything checks out.

Step 5: Ownership transfers. Pedro is now the owner of position 8afed8fc. Angel receives 9.7 SOST. A settlement notice is emitted and the full history is recorded in the audit log.

Alternative: Angel could instead sell only the reward right — keeping the gold-backed principal and selling the future 2,000 SOST reward to Pedro at a discount. The system creates a “child position” for Pedro (reward only) while Angel keeps the parent (principal only).

Why Trade Positions?

▶ Sellers

  • Get immediate liquidity
  • Exit early without waiting for lock expiry
  • Reduce risk exposure
  • Rotate capital into new opportunities
  • Sell only the reward, keep the principal

▶ Buyers

  • Acquire positions at a discount
  • Earn future rewards by waiting
  • Gain gold exposure without creating a contract from scratch
  • Build a portfolio of positions with different maturities

The market exists because the same position doesn’t have the same value for everyone: some prefer money today, others prefer future value.

Ownership Rules

Constitutional Rule

The right to the principal belongs to the principal_owner. The right to the reward belongs to the reward_owner. The escrow pays to the currentBeneficiary, which must always reflect the principal_owner.

Every Model B position has two separate rights:

1. Right to the Principal

The right to recover the gold locked in the escrow at maturity. Belongs to principal_owner.

2. Right to the Reward

The right to receive the SOST reward at maturity. Belongs to reward_owner. Can be sold separately.

Full Position Sale

Before: principal_owner = Angel · reward_owner = Angel · eth_beneficiary = Angel
After: principal_owner = Pedro · reward_owner = Pedro · eth_beneficiary = Pedro
At maturity: Escrow returns gold to Pedro. Reward SOST goes to Pedro.

Reward-Right Sale Only

Before: principal_owner = Angel · reward_owner = Angel · eth_beneficiary = Angel
After: principal_owner = Angel · reward_owner = Pedro · eth_beneficiary = Angel
At maturity: Escrow returns gold to Angel. Reward SOST goes to Pedro.

Automation Roadmap

COMPONENTSTATUSFUNCTION
Settlement EngineOperationalVerifies signatures, executes transfers, updates ownership
E2E RelayOperationalEncrypted coordination, blind transport, offline delivery
Position RegistryOperationalTracks principal_owner, reward_owner, lifecycle
Maturity TrackerOperationalMonitors unlock times, detects maturity
SOSTEscrow v1Deployed (Sepolia)Immutable lock, pays original depositor only
SOSTEscrow v2ImplementedAdds currentBeneficiary — pays whoever owns the principal
Auto-Withdraw DaemonImplementedCalls withdraw() automatically at maturity
Reward EngineImplementedAutomatically credits reward SOST to reward_owner
Current status: SOSTEscrow v1 deployed on Sepolia. SOSTEscrow v2 (dynamic beneficiary + settlementOperator) implemented and tested. Auto-withdraw daemon and reward settlement engine implemented. Limited alpha remains operator-assisted while live proof and external audit are completed.

PART 1 — SOST DEX

Decentralized peer-to-peer exchange for tokenized gold assets

1. Exchange Parameters

Core configuration for the SOST DEX bilateral exchange engine. All trades settle through peer-to-peer escrow with no central counterparty.

ParameterValueDescription
Trading PairsSOST/XAUT, SOST/PAXGTokenized gold pairs only
Settlement ModeBilateral EscrowBoth parties lock funds before settlement
Message SigningED25519All trade messages cryptographically signed
ETH Confirmations6Required confirmations for ETH-side locks
Deal Expiry3,600 sUnmatched offers expire after 1 hour
Daemon Tick5 sTrade engine polling interval
ETH Watcher15 sEthereum chain polling interval

Supported Gold Tokens

TokenDecimalsBackingStandard
XAUT (Tether Gold)61 token = 1 troy oz = 31,103 mgERC-20
PAXG (Paxos Gold)181 token = 1 troy oz = 31,103 mgERC-20

2. Trade Message Types

All messages are ED25519-signed and relayed via the SOST E2E encrypted protocol. Each message type drives the deal state machine forward.

Message TypeDirectionPayloadEffect
trade_offerMaker → Networkpair, side (buy/sell), amount, price, expiryCreates deal in CREATED state
trade_acceptTaker → Makeroffer_id, taker_pubkey, taker_eth_addressTransitions to NEGOTIATED
trade_cancelEither → Eitherdeal_id, reasonTransitions to EXPIRED (if pre-lock)
settlement_noticeEither → Eitherdeal_id, eth_txid, sost_txid, proofsTransitions to SETTLED

3. Deal State Machine

Every deal progresses through a deterministic state machine. The happy path flows left-to-right; alternative flows handle failures and disputes.

Happy Path

CREATED NEGOTIATED AWAITING_ETH_LOCK AWAITING_SOST_LOCK BOTH_LOCKED SETTLING SETTLED

Alternative Flows

CREATED EXPIRED   (deal_expiry exceeded, no acceptance)
NEGOTIATED EXPIRED   (lock timeout, either party cancels)
AWAITING_ETH_LOCK EXPIRED   (ETH lock not confirmed in time)
AWAITING_SOST_LOCK REFUND_PENDING REFUNDED   (SOST lock failed, ETH refunded)
BOTH_LOCKED DISPUTED   (settlement proof mismatch)
StateDescriptionTimeout
CREATEDOffer broadcast, awaiting taker3,600 s
NEGOTIATEDTaker accepted, exchanging lock addresses600 s
AWAITING_ETH_LOCKWaiting for gold token lock on Ethereum (6 confirmations)1,800 s
AWAITING_SOST_LOCKETH confirmed, waiting for SOST escrow lock1,200 s
BOTH_LOCKEDBoth sides locked, ready to settle3,600 s
SETTLINGSettlement transactions broadcast1,800 s
SETTLEDBoth sides confirmed, deal complete
EXPIREDDeal timed out at any pre-lock stage
REFUND_PENDINGOne side locked, other failed; initiating refund7,200 s
REFUNDEDLocked funds returned to original party
DISPUTEDSettlement proof mismatch, requires resolution

4. Settlement Flow

Step-by-step bilateral escrow settlement between maker and taker. All steps are cryptographically verified via ED25519 signatures.

Step 1: OFFER
  Maker broadcasts trade_offer (pair, amount, price, expiry)
  Signed with maker's ED25519 key
  Deal enters CREATED state

Step 2: ACCEPT
  Taker sends trade_accept (offer_id, taker_pubkey, taker_eth_address)
  Signed with taker's ED25519 key
  Deal enters NEGOTIATED state

Step 3: ETH LOCK
  Gold-side party locks XAUT/PAXG in Ethereum escrow contract
  ETH Watcher polls every 15s for confirmation
  After 6 ETH confirmations: deal enters AWAITING_SOST_LOCK

Step 4: SOST LOCK
  SOST-side party creates SOST escrow transaction (OUT_ESCROW_LOCK)
  Transaction confirmed on SOST chain
  Deal enters BOTH_LOCKED state

Step 5: SETTLEMENT
  Both parties release escrow to counterparty addresses
  ETH escrow releases gold tokens to buyer
  SOST escrow releases SOST to seller
  Deal enters SETTLING state

Step 6: NOTICE
  Both parties broadcast settlement_notice with tx proofs
  ETH Watcher confirms gold token transfer (6 confirmations)
  SOST node confirms SOST transfer
  Deal enters SETTLED state (final)
Refund path: If Step 4 (SOST lock) fails after Step 3 (ETH lock), the deal enters REFUND_PENDING. The ETH escrow contract has a timelock that allows the gold-side party to reclaim tokens after the refund timeout (7,200 s).

5. Position Pricing

Position valuation combines spot gold backing with time-discounted future rewards from PoPC contracts. This provides a fair-value reference for DEX trades.

Pricing Formula

position_value = gold_backing + time_discounted_rewards - illiquidity_discount

gold_backing     = oz_held * spot_gold_price
reward_component = annual_rate * remaining_term * gold_backing
illiquidity      = 3% * gold_backing

Model A: 12%/yr reward rate (self-custody, higher risk/reward)
Model B: 5%/yr reward rate (escrow, lower risk/reward)
Illiquidity discount: 3% (compensates for lock-up period)

Example: 1 oz XAUT, Model A, 12-month contract, 6 months remaining

gold_backing     = 1 oz * $2,400 = $2,400
reward_component = 12% * 0.5yr * $2,400 = $144
illiquidity      = 3% * $2,400 = -$72
position_value   = $2,400 + $144 - $72 = $2,472

PART 2 — PoPC Contracts

Proof of Personal Custody — on-chain gold backing with verifiable reserves

6. Model A vs Model B

Two custody models serve different risk profiles. Model A rewards self-custody with higher yields; Model B offers simplicity through immutable escrow.

AttributeModel A (Self-Custody)Model B (Escrow)
Gold LocationUser's own ETH wallet (EOA)Immutable EVM escrow contract
Bond RequiredYes (20-30% of gold value in SOST)No bond required
Reward PayoutPeriodic from PoPC PoolImmediate from PoPC Pool
Protocol Fee3%8%
AuditsRandom, entropy-basedNone (escrow is self-proving)
Slash RiskYes — 50% PoPC Pool + 50% Gold VaultNone
Reward Floor≥ 1% (min 10 SOST)≥ 0.5% (min 5 SOST)
Hard Cap1,000 SOST per contract · 1,000 max active contracts
Durations1 / 3 / 6 / 9 / 12 months1 / 3 / 6 / 9 / 12 months
BlacklistBlacklisted after 3 slashes
Escrow contract: Model B uses an immutable EVM escrow with no admin key, no upgrade proxy, and no withdrawal function until timelock expiry. The contract is self-proving — no audits are needed because funds are cryptographically locked.

7. Reward Rates

Annualized reward rates scale with lock duration. Longer commitments earn higher yields. All rates are percentages of gold value, paid in SOST from the PoPC Pool.

DurationModel A RateModel B Rate
1 month1%0.4%
3 months4%1.5%
6 months9%3.5%
9 months14%5.5%
12 months20%8%
Reward floors: Model A minimum reward is 1% (at least 10 SOST per payout). Model B minimum reward is 0.5% (at least 5 SOST per payout). These floors ensure small positions still receive meaningful compensation.

8. Bond Sizing

Model A requires a SOST bond proportional to gold value. The bond percentage decreases as the SOST/gold ratio increases, incentivizing larger positions while managing protocol risk.

Ratio (bps)Bond %Description
< 100 bps25%Low ratio — maximum bond requirement
100 – 500 bps20%Standard ratio
500 – 1,000 bps15%Elevated ratio
1,000 – 5,000 bps12%High ratio
≥ 5,000 bps10%Maximum ratio — minimum bond

The ratio is calculated as (sost_value_usd / gold_value_usd) * 10000 in basis points. Higher SOST-to-gold ratios indicate greater protocol coverage, allowing reduced bond requirements.

9. Anti-Whale Tiers

To prevent concentration risk and ensure broad participation, the protocol applies acceptance limits based on gold position size.

Gold Amount (oz)Acceptance RateEffect
0 – 10 oz100%Always accepted
10 – 50 oz75%Reduced acceptance
50 – 200 oz50%Half acceptance rate
> 200 ozREJECTEDPosition too large — must split
Hard limit: Positions exceeding 200 oz are unconditionally rejected. Large holders must split across multiple contracts (each up to 200 oz). Combined with the 1,000 max active contracts limit, this bounds total protocol exposure.

10. Dynamic Reward Adjustment

Rewards adjust dynamically based on total protocol participation to maintain sustainable yield from the PoPC Pool.

PUR Formula (Pool Utilization Ratio)

PUR = active_contracts / max_contracts
    = active_contracts / 1000

dynamic_factor = participation_tier_multiplier(PUR)
effective_rate = base_rate * dynamic_factor

Participation Tiers

Active ContractsPUR RangeDynamic FactorEffect
0 – 250 – 2.5%100%Full rewards (bootstrap phase)
26 – 502.6 – 5%75%Slight reduction
51 – 1005.1 – 10%50%Moderate reduction
101 – 20010.1 – 20%30%Significant reduction
201 – 50020.1 – 50%15%Heavy reduction
501 – 1,00050.1 – 100%8%Minimum factor (high utilization)

Example: With 150 active contracts (PUR = 15%), a Model A 12-month base rate of 20% becomes: 20% * 30% = 6% effective annualized rate.

11. Reputation System

Model A custodians build reputation through successful audits. Higher reputation reduces audit frequency, rewarding honest behavior.

StarsStatusAudit ProbabilityRequirements
0New30%Initial state for all custodians
1Established20%1 successful audit cycle
3Trusted10%3 consecutive successful audits
5Exemplary5%5 consecutive successful audits

Audit Mechanics

Audit entropy:  SHA256(block_id || commit || checkpoints_root)
Audit grace:    288 blocks (48 hours)
Slash penalty:  50% to PoPC Pool + 50% to Gold Vault
Blacklist:      After 3 slashes (permanent ban from Model A)

Audit challenges are derived from ConvergenceX entropy (block_id, commit, checkpoints_root), making them unpredictable and tamper-proof. Custodians have a 288-block (48-hour) grace period to respond to an audit challenge before being slashed.

12. Gold Vault Governance

Constitutional governance rules for the Gold Vault. These rules are immutable and enforced at consensus level.

Activation: Gold Vault governance rules GV1–GV4 activate at block 10,000.
RuleNameDescription
GV1Accumulation OnlyGold Vault funds may only be used to purchase physical gold or tokenized gold (XAUT, PAXG). No other expenditures permitted.
GV2Transparent AccountingEvery Gold Vault transaction must include an on-chain memo referencing the gold acquisition (weight, purity, custodian, or token contract address).
GV3Multi-Signature RequirementGold Vault disbursements require multi-signature authorization. No single key can move Gold Vault funds.
GV4Quarterly Proof of ReservesThe protocol must publish a quarterly proof-of-reserves report linking on-chain Gold Vault balances to verifiable gold holdings (physical receipts or Ethereum token balances).

13. Constitutional Addresses

Hardcoded protocol addresses receiving 25% each of every block reward. These are immutable and enforced by consensus rules CB4 (output order) and CB6 (PKH validation).

RoleAddressAllocation
PoPC Poolsost1d876c5b8580ca8d2818ab0fed393df9cb1c3a30f25% of every block reward
Gold Vaultsost11a9c6fe1de076fc31c8e74ee084f8e5025d2bb4d25% of every block reward

The remaining 50% goes to the miner who solves the block. The PoPC Pool funds all custody rewards (Model A and Model B). The Gold Vault accumulates funds exclusively for gold acquisition under GV1–GV4 governance rules.

Coinbase Split (50/25/25)

q = (subsidy + fees) / 4
miner     = (subsidy + fees) - 2*q    // 50% + rounding remainder
gold_vault = q                         // 25% → sost11a9c6fe1de...
popc_pool  = q                         // 25% → sost1d876c5b85...
Enforcement: Any block deviating from the 50/25/25 split or sending gold/popc funds to addresses other than the constitutional addresses is rejected at consensus level. These addresses cannot be changed without a hard fork.
🎮