Soroban smart contracts for atomic IP swaps using USDC, IP registry, and ZK verification.
atomic_swap: Atomic swaps with USDC payments, pause functionality, buyer/seller indexing.ip_registry: Register and query IP assets with TTL.zk_verifier: Merkle tree ZK proof verification with TTL.
See contracts/ for sources and docs/architecture.md for sequence diagrams.
Build all contracts:
./scripts/build.shBuild a specific contract:
./scripts/build.sh <contract_name>Available contracts: ip_registry, atomic_swap, zk_verifier
Example:
./scripts/build.sh atomic_swapRun tests:
./scripts/test.sh./scripts/deploy_testnet.shFull buyer UI:
- Deploy contracts (
./scripts/deploy_testnet.sh, note IDs in.env) - Open
frontend/index.html - Browse listings (demo data; real: query ip_registry.list_by_owner)
- Click "Initiate Swap" → enter USDC amount
- Approve USDC spend → Initiate (stubs; extend Freighter + full RPC XDR)
- Note swap_id for key reveal
Input atomic_swap ID + swap_id → fetch status/key
Note: Vanilla JS + Stellar SDK CDN. Stubs for RPC/wallet. Update CONTRACT_IDS in app.js with deployed IDs.
TBD (add LICENSE file if needed).
Workspace using Soroban SDK v22.0.0