Swarms logo

Vault Mode

Holders only

This agent โ€” wrapsynth is gated. Hold $WRAPSYNTH to unlock the full agent.

wrapsynth

Wrapsynth is bringing Monero's anonymity set to DeFi and DeFi liquidity to Monero # โ›ด๏ธ WrapSynth **A trustless cross-chain ferry bringing Monero to EVM and Solana using atomic-swap commitments and overcollateralized vaults.** ๐ŸŒ **[wrapsynth.com](https://wrapsynth.com)** WrapSynth enables trust-minimized transfers of Monero (XMR) onto EVM chains and Solana. Liquidity providers run overcollateralized vaults (150% minimum) and mint `wsXMR` against incoming XMR; redemptions burn `wsXMR` and release XMR back to the user. Both legs are bound by Ed25519 secret commitments in an HTLC-style atomic swap, so neither party can take funds without the counterparty completing their side โ€” **no bridge custodian and no ZK circuits**. --- ## โœจ Key Features ### Core Technology - **Atomic-Swap Protocol**: HTLC-style secret commitments for trustless XMR โ†” wsXMR exchange, with timeout-based slashing for non-compliance. - **Ed25519 Verification**: Secret reveals are verified on-chain against their commitments using an Ed25519 library (EVM) / Ed25519 instruction-sysvar checks (Solana), matching Monero's signature curve. - **Overcollateralized Vaults**: Each LP runs an isolated vault with its own collateral, debt, and risk parameters. - **Yield-Bearing Collateral**: On Gnosis, collateral is sDAI (auto-converted from xDAI deposits), so idle collateral earns the DAI Savings Rate. - **Diamond / Hub-Facet Architecture**: A single state-owning hub with hot-swappable logic facets keeps the system under the 24KB contract-size limit and upgrade-friendly. ### Security & Trust Model - **Overcollateralization**: 150% minimum collateral ratio backs all outstanding wsXMR. - **Liquidation**: 120% liquidation threshold with a 110% liquidator payout (10% bonus). - **Atomic-Swap Guarantees**: Cryptographic commitments prevent fund loss for both user and LP. - **Timeout Protection**: Block-based mint/burn windows (~5s/block on Gnosis) with on-chain slashing if a counterparty stalls. - **Griefing Protection**: Configurable mint griefing deposits and LP ready-bonds deter spam against vaults. - **Immutable Token**: `wsXMR` has no admin keys โ€” only the hub can mint or burn. ### DeFi Integration - **ERC-20 + Permit**: `wsXMR` is a standard ERC-20 with EIP-2612 gasless approvals (8 decimals). - **Uniswap V3 (Gnosis)**: Native integration for buy-and-burn and a concentrated-liquidity router (CoLP) for wsXMR pools. - **Multi-Chain**: Live on Gnosis Chain; Anchor program for Solana. --- ## ๐Ÿ—๏ธ Monorepo Structure WrapSynth is a multi-chain monorepo with clear separation between implementations: - **`ethereum/`** โ€” EVM implementation (Gnosis Chain). Foundry-based Solidity contracts (diamond/hub-facet), deploy/test scripts, and a Rust LP node. - **`solana/anchor-program/`** โ€” Anchor program (`wrapsynth-vault-manager`) implementing the same vault and atomic-swap mechanics natively on Solana. - **`frontend/`** โ€” Web interface supporting both chains. - **`docs/`** โ€” Technical design docs and sequence diagrams. --- ## ๐Ÿš€ Current Status **Development Phase**: โœ… **Deployed to Gnosis Chain Mainnet** (experimental / unaudited) ### ๐ŸŒ Live Deployment โ€” Gnosis Chain (ChainID: 100) Deployed June 4, 2026. Collateral: **sDAI**. Oracle: **RedStone** pull oracle. | Contract | Address | | --- | --- | | **wsXMR Token** | [`0x8890f651190c838651623de077474a98e37803ab`](https://gnosisscan.io/address/0x8890f651190c838651623de077474a98e37803ab) | | **wsXmrHub** | [`0xd32e2ece901094550b81ab5051a72256761514d6`](https://gnosisscan.io/address/0xd32e2ece901094550b81ab5051a72256761514d6) | | **RedStoneOracleFacet** | [`0x01acec458fd3e8508510cbdc03a8f64532a10618`](https://gnosisscan.io/address/0x01acec458fd3e8508510cbdc03a8f64532a10618) | | **VaultFacet** | [`0xf2ec5240c442bba6674a873343ec43c451467229`](https://gnosisscan.io/address/0xf2ec5240c442bba6674a873343ec43c451467229) | | **MintFacet** | [`0x35da334de761b200da3242429b884a00509bc32b`](https://gnosisscan.io/address/0x35da334de761b200da3242429b884a00509bc32b) | | **BurnFacet** | [`0x779e5a10f4ba60fbc87c1dee79f09168547fda09`](https://gnosisscan.io/address/0x779e5a10f4ba60fbc87c1dee79f09168547fda09) | | **LiquidationFacet** | [`0xbc5ffaaa057030b5e6b1f13807f54fd029c57c94`](https://gnosisscan.io/address/0xbc5ffaaa057030b5e6b1f13807f54fd029c57c94) | | **YieldFacet** | [`0x6d242f08ec7d704b5824f1334c192360f2966add`](https://gnosisscan.io/address/0x6d242f08ec7d704b5824f1334c192360f2966add) | | **LiquidityRouter** | [`0x3235ffe7b51b3726bc0f398da21ed0583103f106`](https://gnosisscan.io/address/0x3235ffe7b51b3726bc0f398da21ed0583103f106) | External: **sDAI** [`0xaf204776c7245bF4147c2612BF6e5972Ee483701`](https://gnosisscan.io/address/0xaf204776c7245bF4147c2612BF6e5972Ee483701) ### Solana โ€” Anchor Program - **Program ID**: `EZ1hsgYwmqmCY5Gzw9mwnJnJE4PJcKX5hHw5MZXk2ssy` - **Oracle**: Pyth (`PriceUpdateV2`) for XMR/USD and collateral feeds. ### Next Steps 1. โœ… ~~Deploy hub + facets and wsXMR to Gnosis mainnet~~ **COMPLETE** 2. LP server infrastructure for vault management 3. End-to-end testing against Monero stagenet 4. Security audit before public launch --- ## ๐Ÿงฉ Architecture ### EVM: Hub-and-Facet (Diamond) The EVM implementation is **not** a single monolithic contract. State and logic are separated: - **`wsXmrHub`** โ€” owns all state (via `wsXmrStorage`), holds all collateral, controls `wsXMR` mint/burn, and routes calls to facets through a selector-dispatch table. Uses EIP-1153 transient storage to gate delegate-call context, plus a reentrancy guard. Only registered facets may mutate state. - **`wsXmrStorage`** โ€” the shared, append-only storage layout inherited by the hub and every facet (vaults, mint/burn requests, debt index, oracle prices, constants). - **Facets** (logic only, state accessed through the hub): - **VaultFacet** โ€” create/fund vaults, manage collateral and parameters. - **MintFacet** โ€” XMR โ†’ wsXMR mint lifecycle. - **BurnFacet** โ€” wsXMR โ†’ XMR burn lifecycle. - **LiquidationFacet** โ€” health checks and liquidation of undercollateralized vaults. - **YieldFacet** โ€” sDAI yield harvesting / buy-and-burn. - **OracleFacet** โ€” price reads + staleness checks (see below). - **`wsXMRLiquidityRouter`** โ€” Uniswap V3 concentrated-liquidity (CoLP) router for wsXMR pools. ### Oracles - **EVM (Gnosis): RedStone pull oracle.** `RedStoneOracleFacet` extends RedStone's `PrimaryProdDataServiceConsumerBase`; price data is injected into the transaction calldata, verified on-chain, and read for the `XMR` and `DAI` feeds. Prices arrive in 8 decimals and are normalized to 18. Default staleness window is 2 minutes; RedStone charges no verification fee. A `SimpleOracleFacet` variant accepts prices pushed by a trusted updater that pulls from the RedStone API โ€” useful for chains where calldata injection isn't convenient. - **Solana: Pyth.** `utils/oracle.rs` parses Pyth `PriceUpdateV2` accounts directly from raw bytes (spot + EMA), enforces a feed-ID match, a confidence check (`conf ร— 10 โ‰ค price`), and a staleness window, then normalizes to 18 decimals to mirror the EVM math exactly. - **Note on Chainlink Data Streams.** The repo includes a minimal `IDataStreamsVerifier` interface and a `MockVerifierProxy`, and the hub storage carries a `verifierProxy` slot. This is scaffolding for evaluating Chainlink Data Streams (available on Gnosis) as an alternative XMR/USD source; it is **not** the active oracle. XMR/USD is not available as a classic Chainlink Data Feed on Gnosis, which is why a pull oracle (RedStone) is used instead. ### High-Level Flow ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Monero โ”‚ โ”‚ Gnosis / โ”‚ โ”‚ Mainnet โ”‚ โ”‚ Solana โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ 1. User initiates mint, posts Ed25519 claim โ”‚ โ”‚ commitment + griefing deposit โ”‚ โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚ โ”‚ 2. User sends XMR to LP's Monero address โ”‚ โ”‚ 3. LP confirms receipt โ†’ setMintReady (+ bond) โ”‚ โ”‚ 4. User reveals secret โ†’ commitment verified โ”‚ โ”‚ (Ed25519) โ†’ wsXMR minted, deposit refunded โ”‚ โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚ โ”‚ โ”‚ โ”‚ 5. Burn: user requests w/ XMR addr + secret hash โ”‚ โ”‚ โ†’ wsXMR + LP collateral reserved โ”‚ โ”‚ 6. LP sends XMR off-chain โ”‚ โ”‚ 7. User commits burn โ†’ wsXMR burned, collateral โ”‚ โ”‚ escrowed โ”‚ โ”‚ 8. LP reveals secret โ†’ collateral released โ”‚ โ”‚ (timeout โ†’ user slashes & seizes collateral) โ”‚ ``` --- ## ๐Ÿ“– How It Works ### Minting (Monero โ†’ wsXMR) 1. **Create & fund vault** (LP): create a vault and deposit collateral (sDAI on Gnosis) at โ‰ฅ150% of intended debt. 2. **Initiate mint** (User): submit an on-chain mint request with an Ed25519 claim commitment and a griefing deposit; the target vault's debt is reserved. 3. **Send XMR** (User): transfer XMR to the LP's Monero address off-chain. 4. **Mark ready** (LP): confirm XMR receipt and post a ready-bond, moving the request to `READY`. 5. **Finalize** (User): reveal the secret; it's verified against the commitment, `wsXMR` is minted to the recipient, and the griefing deposit is refunded. ### Burning (wsXMR โ†’ Monero) 1. **Request burn** (User): specify Monero destination + secret hash; `wsXMR` and LP collateral are reserved. 2. **Send XMR** (LP): pay the user in XMR off-chain. 3. **Commit burn** (User): confirm receipt; `wsXMR` is burned and collateral escrowed. 4. **Finalize** (LP): reveal the secret to release the escrowed collateral. 5. **Timeout** : if the LP fails to reveal in time, the user slashes the vault and seizes collateral. Mint statuses: `PENDING โ†’ READY โ†’ COMPLETED` (or `CANCELLED`). Burn statuses: `REQUESTED โ†’ PROPOSED โ†’ COMMITTED โ†’ COMPLETED` (or `SLASHED` / `CANCELLED`). --- ## ๐Ÿ› ๏ธ Development Setup ### Prerequisites - **Foundry** (forge/cast) โ€” install from [getfoundry.sh](https://getfoundry.sh) - **Node.js** v18+ (frontend + legacy scripts) - **Rust** (LP node + Solana program) โ€” [rustup.rs](https://rustup.rs) - **Anchor** + **Solana CLI** (Solana program) ### Clone (with submodules) ```bash git clone --recurse-submodules https://github.com/madschristensen99/wrapsynth.git cd wrapsynth ``` Submodules: `openzeppelin-contracts`, `forge-std`, `chainlink`, `redstone-oracles-monorepo`, `svm-fhe`. ### EVM (Foundry) ```bash cd ethereum forge build forge test # Configure environment cp .env.example .env # set PRIVATE_KEY, GNOSIS_RPC_URL, GNOSISSCAN_API_KEY # Deploy to Gnosis (RedStone oracle wiring) forge script script/DeployGnosisRedStone.s.sol --rpc-url gnosis --broadcast --verify ``` Build profile: solc `0.8.28`, EVM `cancun`, `via_ir = true`, `optimizer_runs = 1`. ### LP Node (Rust) ```bash cd ethereum/lp-node cargo build --release cargo run --release ``` The LP node manages vaults, watches chain events, talks to a Monero RPC wallet, and pushes RedStone prices on-chain (`oracle.rs` pulls from `api.redstone.finance`). ### Solana (Anchor) ```bash cd solana/anchor-program anchor build anchor test ``` Instructions: `initialize`, `vault_management`, `mint_flow`, `burn_flow`, `liquidation`, `buy_and_burn`, `reconciliation`, `withdrawals`. --- ## ๐Ÿ” Security โš ๏ธ **This is experimental, unaudited research software. Do not use with real funds.** Before any production deployment: professional security audit, formal verification of critical components, extensive testnet/stagenet testing, and legal/regulatory review. Economic parameters: 150% collateral ratio, 120% liquidation threshold, 110% liquidator payout, 2-minute oracle staleness window, block-based mint/burn timeouts. --- ## ๐Ÿ“š Documentation - [Ethereum Contracts](ethereum/contracts) โ€” Solidity (hub, facets, libraries) - [LP Node](ethereum/lp-node/README.md) โ€” setup and operation - [Solana Program](solana/anchor-program/README.md) โ€” Anchor program docs - [Seed Storage Design](docs/SEED_STORAGE_IMPLEMENTATION.md) - [Sequence Diagrams](docs/sequenceDiagrams.md) ### External Resources - [Monero Developer Guides](https://www.getmonero.org/resources/developer-guides/) - [RedStone Oracles](https://docs.redstone.finance/) โ€” EVM price feeds - [Pyth Network](https://pyth.network/) โ€” Solana price feeds - [Atomic Swaps](https://en.bitcoin.it/wiki/Atomic_swap) ยท [HTLC](https://en.bitcoin.it/wiki/Hash_Time_Locked_Contracts) - [Uniswap V3](https://docs.uniswap.org/contracts/v3/overview) --- ## ๐Ÿ“„ License LGPL-3.0 for contracts (see SPDX headers); MIT where noted. See [LICENSE](LICENSE). --- Built with โค๏ธ for privacy and decentralization Source: https://github.com/madschristensen99/wrapsynth

Rating
No ratings yet
Your balance
Wallet not connected
Token
21XGWRโ€ฆviswrm

Buy $WRAPSYNTH

SOL
You receive0 WRAPSYNTH
Open on Axiom

You must hold at least $1 worth of this token to unlock vaulted content.

Loading recommendations...

Yuki

Your Marketplace Companion

Agent

Hey, I'm Yuki ๐Ÿ‘‹

Ask me about specific products, customer support, or anything about the Swarms Marketplace.