{"id":45413131,"url":"https://github.com/jayzalowitz/mobilecoin-intents","last_synced_at":"2026-02-22T00:41:34.626Z","repository":{"id":328485108,"uuid":"1115700297","full_name":"jayzalowitz/mobilecoin-intents","owner":"jayzalowitz","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-25T11:13:51.000Z","size":250,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-26T23:44:03.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jayzalowitz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-13T11:26:44.000Z","updated_at":"2025-12-25T11:13:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jayzalowitz/mobilecoin-intents","commit_stats":null,"previous_names":["jayzalowitz/mobilecoin-intents"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jayzalowitz/mobilecoin-intents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayzalowitz%2Fmobilecoin-intents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayzalowitz%2Fmobilecoin-intents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayzalowitz%2Fmobilecoin-intents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayzalowitz%2Fmobilecoin-intents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayzalowitz","download_url":"https://codeload.github.com/jayzalowitz/mobilecoin-intents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayzalowitz%2Fmobilecoin-intents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29701155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"ssl_error","status_checked_at":"2026-02-21T23:35:03.832Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-22T00:41:34.046Z","updated_at":"2026-02-22T00:41:34.612Z","avatar_url":"https://github.com/jayzalowitz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MobileCoin Intents\n\n[![License](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE)\n[![Rust](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://www.rust-lang.org/)\n\nA cross-chain swap protocol enabling seamless exchanges between MobileCoin (MOB) and assets on the NEAR blockchain through the NEAR Intents platform.\n\n## Overview\n\nMobileCoin Intents bridges MobileCoin's privacy-focused blockchain with NEAR's intent-based cross-chain transaction system. Users can:\n\n- **Deposit**: Convert MOB to wrapped MOB (wMOB) on NEAR\n- **Withdraw**: Convert wMOB back to MOB\n- **Swap**: Exchange MOB/wMOB for other NEAR-based assets (USDC, NEAR, etc.)\n\nThe protocol uses a competitive solver auction to ensure users get the best prices for their swaps.\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────────────────┐\n│                            User Wallet                                   │\n│                    (MobileCoin + NEAR accounts)                         │\n└────────────────────────────────┬────────────────────────────────────────┘\n                                 │\n                                 ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                      NEAR Intents Protocol                               │\n│              (Intent submission \u0026 broadcasting)                          │\n└────────────────────────────────┬────────────────────────────────────────┘\n                                 │\n                                 ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                    Verifier Contract (defuse-mobilecoin)                 │\n│                    Intent validation \u0026 signature verification            │\n└────────────────────────────────┬────────────────────────────────────────┘\n                                 │\n                                 ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                          Solver Bus (WebSocket)                          │\n│                    Real-time auction for best quotes                     │\n└────────────────────────────────┬────────────────────────────────────────┘\n                                 │\n                                 ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                    Solver Implementations                                │\n│                    (solver-mobilecoin, simple-solver)                    │\n└────────────────────────────────┬────────────────────────────────────────┘\n                                 │\n                                 ▼\n┌─────────────────────────────────────────────────────────────────────────┐\n│                    Bridge \u0026 Token Layer                                  │\n│              (POA Bridge + wMOB NEP-141 Token)                          │\n└────────────────────────────────┬────────────────────────────────────────┘\n                                 │\n                                 ▼\n┌──────────────────────────────────────────────────────────────────────────┐\n│                    Blockchain Layer                                       │\n│              (NEAR Protocol  ←──────→  MobileCoin)                       │\n└──────────────────────────────────────────────────────────────────────────┘\n```\n\n## Modules\n\n| Module | Description |\n|--------|-------------|\n| [`mobilecoin-crypto`](./mobilecoin-crypto) | Ed25519 signature verification, domain-separated signing, batch verification |\n| [`mobilecoin-address`](./mobilecoin-address) | MobileCoin address parsing, validation, and Base58Check encoding |\n| [`mobilecoin-keys`](./mobilecoin-keys) | CryptoNote stealth address derivation and one-time key generation |\n| [`defuse-mobilecoin`](./defuse-mobilecoin) | NEAR smart contract for intent verification and routing |\n| [`poa-mobilecoin`](./poa-mobilecoin) | Proof-of-Authority bridge and wMOB NEP-141 token contracts |\n| [`solver-mobilecoin`](./solver-mobilecoin) | Production solver implementation for market makers |\n| [`examples/simple-solver`](./examples/simple-solver) | Educational example solver with extensive documentation |\n\n## Quick Start\n\n### Prerequisites\n\n- Rust 1.70 or higher\n- NEAR CLI (for contract deployment)\n- Access to MobileCoin node (for production solvers)\n\n### Building\n\n```bash\n# Clone the repository\ngit clone https://github.com/jayzalowitz/mobilecoin-intents.git\ncd mobilecoin-intents\n\n# Build all modules\ncargo build --release\n\n# Build WASM contracts\ncargo build --release --target wasm32-unknown-unknown -p wmob-token -p mob-bridge -p defuse-mobilecoin\n```\n\n### Running Tests\n\n```bash\n# Run all tests\ncargo test\n\n# Run tests for a specific module\ncargo test -p mobilecoin-crypto\ncargo test -p mobilecoin-keys\n```\n\n### Running the Example Solver\n\n```bash\ncd examples/simple-solver\n\n# Copy and configure environment\ncp .env.example .env\n# Edit .env with your settings\n\n# Run the solver\ncargo run --release\n```\n\n### Bridge Tools\n\n```bash\n# Generate authority keys and custody wallet\ncargo run --example generate-keys -p mobilecoin-crypto\n\n# Generate a deposit proof (for minting wMOB)\ncargo run --example demo-real-deposit -p mobilecoin-crypto\n\n# Generate a withdrawal completion proof\nWITHDRAWAL_ID=0 cargo run --example complete-withdrawal -p mobilecoin-crypto\n\n# Verify a signature\ncargo run --example verify-signature -p mobilecoin-crypto\n```\n\n## How It Works\n\n### Deposit Flow (MOB → wMOB)\n\n1. **Create Intent**: User signs an intent specifying the MOB amount and destination NEAR account\n2. **Submit Intent**: Intent is broadcast to the NEAR Intents verifier contract\n3. **Solver Auction**: Solvers compete by submitting quotes via the solver bus\n4. **Winner Selection**: Best quote wins; solver receives assignment notification\n5. **Settlement**:\n   - User sends MOB to the bridge custody address\n   - Bridge authorities verify the deposit (2-of-3 multi-sig)\n   - Authorities sign a deposit proof attesting to the on-chain MOB transfer\n   - User (or anyone) submits the signed proof to the NEAR bridge contract\n   - Bridge verifies signatures and mints wMOB to the user's NEAR account\n\n### Withdrawal Flow (wMOB → MOB)\n\n1. **Create Intent**: User creates an intent to convert wMOB to MOB\n2. **Lock wMOB**: User's wMOB is locked in the verifier contract\n3. **Solver Processing**: Winning solver initiates withdrawal via the bridge\n4. **Bridge Processing**:\n   - User calls `withdraw()` on bridge contract, burning their wMOB\n   - Bridge records a pending withdrawal request\n   - Authorities send MOB from custody to user's MobileCoin address\n   - Authorities sign a completion proof attesting to the MOB transfer\n   - Anyone submits the proof to finalize the withdrawal on NEAR\n\n### Solver Flow\n\n```\nIntentRequest (from verifier)\n        │\n        ▼\n┌───────────────────┐\n│  Calculate Quote  │ ← Price feed + liquidity check\n└───────────────────┘\n        │\n        ▼\nQuoteResponse (to solver bus)\n        │\n        ▼\nIntentAssigned (if won)\n        │\n        ▼\n┌───────────────────┐\n│ Execute Settlement│ ← Bridge interaction\n└───────────────────┘\n        │\n        ▼\nSettleResult (completion)\n```\n\n## Security Features\n\n### Cryptographic Security\n\n- **Ed25519 Signatures**: RFC 8032 compliant signature verification\n- **Domain Separation**: Prevents cross-context signature attacks\n- **CryptoNote Stealth Addresses**: One-time keys per transaction for privacy\n- **Secure Memory**: Key material is zeroized after use\n\n### Bridge Security\n\n- **Multi-Signature Authority**: Configurable threshold (default 2-of-3)\n- **Replay Protection**: Transaction hash and nonce tracking\n- **Rate Limiting**: Per-hour limits on deposits, withdrawals, and volume\n- **Emergency Controls**: Pause/unpause capability for incident response\n- **Amount Validation**: Min/max limits per transaction\n\n### Trust Model\n\nThis bridge uses a **Proof-of-Authority (PoA)** design. MobileCoin does not support smart contracts or light clients, so trustless verification from NEAR is not possible. Instead:\n\n- **N-of-M authorities** must sign to approve deposits and withdrawals\n- Each authority independently monitors the MobileCoin blockchain\n- Authorities are expected to be separate entities (e.g., MobileCoin Foundation, NEAR Foundation, independent operator)\n- **Trust assumption**: If threshold authorities collude, they could mint unbacked wMOB or steal custody funds\n\nThis is similar to how WBTC (Wrapped Bitcoin) works on Ethereum - a custodial bridge with multi-sig control.\n\n### Smart Contract Security\n\n- **Overflow Protection**: Checked arithmetic throughout\n- **Input Sanitization**: Address and amount validation\n- **Access Control**: Role-based authority management\n\n## Configuration\n\n### Solver Configuration\n\n| Variable | Description | Example |\n|----------|-------------|---------|\n| `SOLVER_ID` | Unique solver identifier | `my-solver-1` |\n| `SOLVER_BUS_URL` | WebSocket endpoint | `wss://solver-bus.near-intents.org` |\n| `NEAR_RPC_URL` | NEAR RPC endpoint | `https://rpc.mainnet.near.org` |\n| `MOB_NODE_URL` | MobileCoin node URL | `https://mob.node.example.com` |\n| `MIN_PROFIT_BPS` | Minimum spread (basis points) | `50` (0.5%) |\n| `MAX_SLIPPAGE_BPS` | Slippage tolerance | `100` (1%) |\n| `QUOTE_TIMEOUT_MS` | Quote validity period | `5000` |\n\n### Bridge Configuration\n\n```rust\nRateLimitConfig {\n    max_deposits_per_hour: 100,\n    max_withdrawals_per_hour: 100,\n    max_volume_per_hour: 1_000_000_000_000_000, // 1000 MOB\n    min_amount: 1_000_000,                       // 0.000001 MOB\n    max_amount: 100_000_000_000_000,            // 100 MOB\n}\n```\n\n## Supported Trading Pairs\n\n| From | To | Flow |\n|------|-----|------|\n| MOB | wMOB | Deposit via bridge |\n| wMOB | MOB | Withdrawal via bridge |\n| MOB | USDC | Cross-chain swap |\n| MOB | NEAR | Cross-chain swap |\n| wMOB | USDC | NEAR-side swap |\n| wMOB | NEAR | NEAR-side swap |\n\n## Development\n\n### Project Structure\n\n```\nmobilecoin-intents/\n├── mobilecoin-crypto/     # Cryptographic primitives\n├── mobilecoin-address/    # Address handling\n├── mobilecoin-keys/       # Key derivation (CryptoNote)\n├── defuse-mobilecoin/     # NEAR verifier contract\n├── poa-mobilecoin/\n│   └── contracts/\n│       ├── wmob-token/    # NEP-141 wMOB token\n│       └── mob-bridge/    # POA bridge contract\n├── solver-mobilecoin/     # Production solver\n├── examples/\n│   ├── simple-solver/     # Example solver implementation\n│   ├── generate-keys.rs   # Authority \u0026 wallet key generation\n│   ├── demo-real-deposit.rs  # Deposit proof generator\n│   ├── complete-withdrawal.rs # Withdrawal completion proof\n│   └── verify-signature.rs    # Signature verification tool\n├── scripts/               # Deployment scripts\n└── docs/                  # Documentation\n```\n\n### Building for Production\n\n```bash\n# Optimize contracts for size\nRUSTFLAGS='-C link-arg=-s' cargo build \\\n    --release \\\n    --target wasm32-unknown-unknown \\\n    -p wmob-token \\\n    -p mob-bridge \\\n    -p defuse-mobilecoin\n```\n\n### Running a Solver\n\nSee the [simple-solver README](./examples/simple-solver/README.md) for a complete guide on building and running a solver.\n\n## Documentation\n\n- [Architecture Overview](./docs/architecture.md) - Detailed system design\n- [Simple Solver Guide](./examples/simple-solver/README.md) - Step-by-step solver tutorial\n- [API Documentation](https://jayzalowitz.github.io/mobilecoin-intents/) - Rustdoc API reference\n\n## Contributing\n\nContributions are welcome! Please ensure:\n\n1. All tests pass (`cargo test`)\n2. Code is formatted (`cargo fmt`)\n3. Lints pass (`cargo clippy`)\n4. New features include tests and documentation\n\n## License\n\nThis project is dual-licensed under MIT OR Apache-2.0. See [LICENSE](./LICENSE) for details.\n\n## Acknowledgments\n\n- [MobileCoin](https://www.mobilecoin.com/) - Privacy-focused cryptocurrency\n- [NEAR Protocol](https://near.org/) - Scalable blockchain platform\n- [NEAR Intents](https://near.org/intents) - Cross-chain intent framework\n- [CryptoNote](https://cryptonote.org/) - Stealth address protocol\n\n---\n\nBuilt with security and privacy in mind.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayzalowitz%2Fmobilecoin-intents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayzalowitz%2Fmobilecoin-intents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayzalowitz%2Fmobilecoin-intents/lists"}