Demo mode: a reference storefront for eSIM operators. Prices are live, payments are off. Run your own operator →
Travel eSIM · demo
English

eSIM operator kit

Contents

Sell travel data eSIMs under your own name, to people on a website and to AI agents over x402. You need a wholesale account, a server and a domain. The kit is the whole shop: a storefront in five languages that takes crypto on ten networks, a seller node AI agents buy from, and the federation node that makes your offers findable on AIMarket hubs. You are the merchant, and buyers pay straight into your wallets.

Try it first: esim.modelmarket.dev runs this kit in demo mode with live wholesale prices and every page and checkout step. It takes no payment.

Read in: English · Русский · Español · Français · 中文

What you get

PartWhat it does
Storefront (store/)A page per country, which is what travellers search for. Plan filter, checkout, the eSIM's QR code and install link, and its data usage afterwards. In English, Russian, Spanish, French and Chinese.
PaymentsUSDC and USDT on Base, Ethereum, Arbitrum, OP, Polygon, BNB Chain and Avalanche. USDT on Tron, USDC on Solana, USDT and TON on TON. Cards through Stripe if you add it. Each method is on once you give it an address.
Seller node for agents (rails/)esim.quote and esim.status are free and signed. esim.order is paid over x402 in USDC on Base.
Federation node (node/)aimarket node publishes your capabilities to AIMarket hubs, so agents that search a hub find your offers.
HTTPSCaddy on ports 80 and 443, with certificates from Let's Encrypt.

How a sale works

  1. A buyer picks a plan. The price is your wholesale cost plus your margin (MARGIN_PCT, and never less than MIN_MARGIN_USD above cost). It holds for 20 minutes.
  2. The buyer pays to your wallet. The store reads the network and confirms the payment itself. There is no payment processor in between.
  3. The store buys the profile from your eSIM Access balance at the wholesale price. The buyer gets the QR code, the activation code and an install link. Their order page keeps working afterwards and shows the data used and the expiry date.
  4. You keep the difference. Top up the wholesale balance as you sell.

An agent does the same over HTTP: POST /agents/quote, then POST /agents/order with an x402 payment, and the activation code comes in the answer. The payment settles only after the profile exists.

What you need

Quick start

git clone https://github.com/alexar76/esim-operator-kit.git && cd esim-operator-kit
cp .env.example .env            # your domain, store name, margin, wallet addresses
# put the two eSIM Access keys in secrets/ (secrets/README.md lists the files)
mkdir -p data/store data/rails data/node data/caddy
sudo chown 1000:1000 secrets/* && sudo chown -R 1000:1000 data/store data/rails data/node
docker compose up -d --build

Open https://<your domain>/. The store runs in demo mode until you set DEMO_MODE=0. The operator guide walks through every step, the test order and going live.

Documents

Layout

docker-compose.yml   the four services
Caddyfile            HTTPS and routing: /agents/* to rails, /.well-known/ai-market.json and /ai-market/* to node, the rest to store
.env.example         every setting, with comments
secrets/             your keys, one per file (git-ignored, mounted read-only)
data/                orders, token keys, the node's identity, certificates (git-ignored; back it up)
store/               the storefront (Node.js, Express)
rails/               the seller node, and the wholesale client the store uses too
node/                the federation node image (aimarket-hub from PyPI)
docs/                these guides in five languages

Money and keys

Tests

cd rails && npm ci && npm test
cd ../store && npm ci && npm test

The tests need no network and no keys.

The kit on GitHub →