Skip to content

reymom/ic2P2ramp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

icRamp

icRamp is a fully trustless P2P on/off-ramp that works across Bitcoin, Ethereum, Solana, and the Internet Computer, allowing people worldwide to exchange fiat ↔ crypto securely and without custodians.

It leverages the Internet Computer’s unique capabilities:

  • HTTPS Outcalls β†’ verify PayPal + Stripe payments trustlessly
  • ic-alloy EVM RPC β†’ query EVM smart contracts directly from canisters
  • Deterministic Rust canisters β†’ orchestrate cross-chain vault logic
  • Threshold ECDSA β†’ manage Bitcoin transactions
  • Canister-based Solana RPC β†’ sign transactions and verify SPL transfers

Built through 3 ICP Grants (EVM, Bitcoin, Solana + Payment Layer Overhaul).

Key Features

πŸ”— Multi-Chain Wallet β†’ Wallet Settlement

  • BTC (UTXO)
  • ETH & EVM chains (ERC-20)
  • Solana (SPL tokens)
  • ICP (ICRC-1)

🧾 Fiat Payments (Trustlessly Verified)

  • PayPal
  • Revolut
  • Stripe Connect (destination charges, per-order success/cancel URLs)
  • Email provider (credit card for stripe's counterparty)

πŸ’§ Liquid Orders (Milestone 2)

  • Partial Fills: onramper locks only part of the order
  • Top-Ups: offramper adds more liquidity on demand
  • Aggregate fills tracked over time
  • Unified release logic across all chains

Onramper committing a partial fill

Stripe Checkout for a partial fill

πŸ’° Pay-With-Crypto (Wallet↔Wallet Trustless Flow)

Users can settle orders using on-chain payment instead of Stripe/PayPal:

  • BTC β†’ BTC
  • ETH β†’ ERC20
  • SOL β†’ SPL token
  • ICP β†’ ICRC-1

Backend listeners verify chain-specific transactions and release funds accordingly.

Offramper creating a Solana USDC order

🧱 Architecture (High Level)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Frontend (React) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ icramp_backend │◀──▢│ HTTPS Outcalls β”‚ β”‚ (Rust canister) β”‚ β”‚ (PayPal, Stripe) β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Orders / Fills β”‚ β”‚ Payment Providers β”‚ β”‚ Multi-Chain Vault β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ On-Chain Listeners β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ BTC β†’ BTC RPC + T-ECDSA β”‚ β”‚ EVM β†’ ic-alloy + RPC EVM Canister β”‚ β”‚ Solana β†’ SPL transfer parser β”‚ β”‚ ICP β†’ ICRC-1 ledger queries β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸͺ™ Stripe, Revolut, PayPal

  • Stripe Connect onboarding flow
  • Redirect-survival logic
  • Verified via HTTPS Outcalls
  • Stored per-user provider
  • Used for partial fills + top-ups

⚑ EVM Vault (icRamp v2)

  • Minimal Solidity vault contract
  • Only deposit / withdraw / release
  • Business logic moved to ICP
  • getDeposit called via ic-alloy: ABI-free, typesafe, cheap

Old Screenshots

Login Page

Login Page

Profile Page

Profile Page

Create EVM Order

Create EVM Order

Create Bitcoin Order

Create EVM Order

View and Lock Orders

Lock Orders

Pay Order

Lock Orders

Canisters and components

Authentication and Login

icRamp supports login and authentication with email, Internet Identity and Ethereum Walets such as Metamask.

HTTPS Outcalls Canister

The HTTPS Outcalls Canister enables secure HTTPS requests from ICP canisters, allowing for external data fetching and API interactions. It is used particularly to fetch order details from the Paypal API in order to verify the transactions.

EVM RPC Canister

The EVM RPC Canister is a smart contract on the ICP that communicates with Ethereum and other EVM blockchains. It provides an on-chain API for interacting with smart contracts and retrieving blockchain data. It is used to release the funds once the paypal payment is verified.

Exchange Rate Canister

The Exchange Rate Canister retrieves and provides exchange rates for various assets. It uses an external API to fetch real-time exchange rates and serves this data to other canisters within the protocol. It is used to automatically fetch the best market price for the offramper order.

Backend Canister

The Backend Canister handles the core business logic of the icRamp protocol. It manages orders, communicates with the EVM RPC canister for blockchain interactions with the escrow in different EVM blockchains, such as Mantle and Polygon, and verifies paypal payments using the HTTPS Outcalls canister.

Frontend Canister

The Frontend Canister provides a user-friendly interface for interacting with the icRamp protocol. Users can create and manage orders, view exchange rates, make payments and perform other related onramping and offramping operations.

How icRamp Supports ICP Adoption

  • Multi-Chain Interoperability: Bridges Bitcoin, Ethereum, and ICP.

  • Open-Source SDKs & Modules: Provides reusable smart contracts and APIs.

  • Educational Content: Blogs, tutorials, and documentation to onboard developers.

Community Engagement & Future Plans

  • Open-source contributions to encourage adoption.

  • Workshops and hackathons to showcase icRamp.

  • Expanding to Solana and additional fiat onramping solutions.

πŸ› οΈ Usage

Build

To build the canisters, use the following command:

dfx build

Interact

  • Call the get_usd_exchange_rate method to retrieve the exchange rate for a given asset:
dfx canister call backend get_usd_exchange_rate '( "ETH" )'
  • Retrieve and verify a paypal order using the backend canister:
dfx canister call backend verify_transaction '( "0", transaction_id = "4UC03319AV493141A" )'

Locally:

Run the following commands in a new, empty project directory:

git clone https://github.com/reymom/ic2P2ramp.git
cd ic2P2ramp
dfx start --clean --background
npm install
npm run setup # Install packages, deploy canisters, and generate type bindings

npm start # Start the development server

Also, to deploy seamlessly with prepopulated init arguments:

./scripts/deploy/deploy_local.sh

And for updates, check different argument options in:

./scripts/update.sh

πŸ“š Documentation

License

This project is licensed under the MIT license, see LICENSE.md for details. See CONTRIBUTE.md for details about how to contribute to this project.

About

Decentralized onramp and offramp protocol for ICP, Ethereum, Bitcoin and Solana.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5