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.
- Rust (stable, with
wasm32-unknown-unknowntarget)curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup target add wasm32-unknown-unknown
- Stellar CLI — used to build, optimize, and deploy contracts
cargo install --locked stellar-cli --features opt
- Node.js v18+ and npm — required for the frontend
# via nvm (recommended) nvm install 18
git clone https://github.com/unixfundz/Atomic-IP-Marketplace.git
cd Atomic-IP-Marketplace
cp .env.example .env| Variable | Description |
|---|---|
STELLAR_NETWORK |
testnet or mainnet |
STELLAR_RPC_URL |
Soroban RPC endpoint (default: testnet) |
CONTRACT_ATOMIC_SWAP |
Deployed atomic_swap contract ID (filled after deploy) |
CONTRACT_IP_REGISTRY |
Deployed ip_registry contract ID |
CONTRACT_ZK_VERIFIER |
Deployed zk_verifier contract ID |
VITE_* |
Frontend copies of the above for Vite |
ATOMIC_SWAP_ADMIN |
Admin address for contract initialization |
ATOMIC_SWAP_FEE_RECIPIENT |
Address that receives protocol fees |
ATOMIC_SWAP_FEE_BPS |
Fee in basis points (e.g. 250 = 2.5%) |
ATOMIC_SWAP_CANCEL_DELAY_SECS |
Seconds before a buyer can cancel (e.g. 3600) |
# Build and optimize all contracts
./scripts/build.sh
# Build a single contract
./scripts/build.sh atomic_swap
# Available: ip_registry, atomic_swap, zk_verifier./scripts/test.shThis runs cargo test --locked --workspace across all three contracts.
- Start a local Stellar network (requires Docker):
stellar network start local - Add a funded account:
stellar keys generate deployer --network local stellar keys fund deployer --network local
- Set
STELLAR_NETWORK=localandSTELLAR_RPC_URL=http://localhost:8000/soroban/rpcin.env. - Deploy:
./scripts/deploy_testnet.sh
cd frontend
cp .env.example .env # fill in VITE_CONTRACT_* after deploy
npm install
npm run devBuild all contracts:
./scripts/build.shRun tests:
./scripts/test.sh./scripts/deploy_testnet.shPlease report vulnerabilities privately — do not open public issues for security bugs. See SECURITY.md for the full responsible disclosure policy, including the private email contact and any available GitHub advisory channel.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Workspace using pinned Soroban SDK v25.3.0 and soroban-poseidon v25.0.1