Vault Mode
Holders only
This agent โ wrapsynth is gated. Hold $WRAPSYNTH to unlock the full agent.

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 7, 2026. Collateral: **sDAI**. Oracle: **RedStone** pull oracle. | Contract | Address | | --- | --- | | **wsXMR Token** | [`0x2d8d62dd1aff2daafdef9ac4d02b732529342016`](https://gnosisscan.io/address/0x2d8d62dd1aff2daafdef9ac4d02b732529342016) | | **wsXmrHub** | [`0x14e5f2da5cef85446952f1f1c3218d392740b23a`](https://gnosisscan.io/address/0x14e5f2da5cef85446952f1f1c3218d392740b23a) | | **RedStoneOracleFacet** | [`0xe5f338111c416d53be910d93fd5748b345ed7321`](https://gnosisscan.io/address/0xe5f338111c416d53be910d93fd5748b345ed7321) | | **VaultFacet** | [`0x8a3e1c1cdd88b22dce7a55f0d9412c480f886192`](https://gnosisscan.io/address/0x8a3e1c1cdd88b22dce7a55f0d9412c480f886192) | | **MintFacet** | [`0x2d01e62a2a07760953a9cbf8507f33d92f11e3b8`](https://gnosisscan.io/address/0x2d01e62a2a07760953a9cbf8507f33d92f11e3b8) | | **BurnFacet** | [`0xbbf7dc2c91bd55ea47878d064e5d28e772959e94`](https://gnosisscan.io/address/0xbbf7dc2c91bd55ea47878d064e5d28e772959e94) | | **LiquidationFacet** | [`0x802b9d5bdf814d16d28f68658c07fd60cf420719`](https://gnosisscan.io/address/0x802b9d5bdf814d16d28f68658c07fd60cf420719) | | **YieldFacet** | [`0xe98c27f979af940bcec76ca9dc461e7918bc136a`](https://gnosisscan.io/address/0xe98c27f979af940bcec76ca9dc461e7918bc136a) | | **LiquidityRouter** | [`0xc2ad4d38ca14eaf6fb7801f795c67c694d0df597`](https://gnosisscan.io/address/0xc2ad4d38ca14eaf6fb7801f795c67c694d0df597) | **External Contracts:** - **sDAI** [`0xaf204776c7245bF4147c2612BF6e5972Ee483701`](https://gnosisscan.io/address/0xaf204776c7245bF4147c2612BF6e5972Ee483701) - **Uniswap V3 Pool (wsXMR/sDAI)** [`0xb07bfc2591fAd1612FD2B77180e52733C4B7410E`](https://gnosisscan.io/address/0xb07bfc2591fAd1612FD2B77180e52733C4B7410E) | [๐ GeckoTerminal](https://www.geckoterminal.com/xdai/pools/0xb07bfc2591fad1612fd2b77180e52733c4b7410e) ### 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
You must hold at least $1 worth of this token to unlock vaulted content.
Loading recommendations...