Build
Integrator guide
Three ways to put HALFKEY inside your product, and how to show a swap so people trust it.
Three ways in
Add a Monero exit to your app. Your users swap any Solana coin for real XMR without leaving you, and the swap is atomic: no custodian on our side or yours.
Which one to choose
| Widget | SDK | API | |
|---|---|---|---|
| You build | Nothing: drop it in | Your own screens | Your own client |
| Who signs | Your user's wallet, on your page | Your user's wallet, in your app | Your user's wallet |
| Safety checks | Built in | Built in (the SDK refuses bad terms) | Yours to implement |
| Monero side in the browser | Built in | Built in (lock check, collect) | Yours |
| Best for | Pads, dashboards, wallets with a web view | Wallets and apps that want their own look | Back ends and bots |
If you are unsure, start with the widget. Every check a user's safety depends on lives in the SDK, and the widget runs the same SDK, so both carry the protection with no extra work on your side.
Widget
The widget is the same swap card as on HALFKEY, in a frame on your page. It reads the chain itself and talks to makers directly. Setup and options are on the widget page. It is a static page, so you can also host it yourself from the IPFS or Arweave build.
SDK
The SDK is the TypeScript the HALFKEY site runs on. It ships in the HALFKEY repo (source published after launch). Its protocol layer has no Solana dependency (keys, Monero addresses, lock verification, collect); Solana adapters sit on top. Reference and samples: SDK reference.
API
Makers expose a small HTTP API that every client uses: GET /v1/info, GET /v1/quote, POST /v1/swap and GET /v1/swap/<escrow>. Makers are listed in the on-chain registry with their endpoints, so a client finds them without our server. The full reference is in API reference.
Deposit addresses and an order API
not in the program yet
For apps that can only "send to an address" (Telegram bots, exchange-style flows, some wallets): one program-controlled deposit address per swap, with a refund address fixed at quote time. It needs a change in the program, so it is part of the final program round before the mainnet freeze, or a later program version. It is not live; this page will say so when it is.
Integrator fee share
not in the program yet
A share of the protocol fee on every swap you route, paid by the program at settlement to your address. Like deposit addresses it needs a new escrow field, so it ships with the final program round or a later version. Until it is in the program, there is no fee share: we don't make off-chain promises.
UX guidance
People decide whether a swap works in the first two minutes. Show them the proof as it happens.
- Show the tracker steps, in order: Your SOL is in → Maker sent your XMR → Monero blocks n/10 → Finish swap → XMR spendable. Keep the user's words plain: no lock, claim or release language on the screens people swap on.
- Never show a green tick on the maker's word. "Maker sent your XMR" turns green only after the browser checked the Monero transaction with the view key. Until then say "Maker is sending".
- Set the 10-confirmation wait up front. "XMR on its way in ~2 min, spendable in ~20." Monero's 10-block lock can't be shortened.
- Say they can leave. "Close this page. Your swap keeps going and shows up in My swaps on any device."
- One all-in number before the signature: spread plus fee, with price impact on its own line for coin sales.
- Explain the collect choice: sweeping puts a fresh ~20 minute lock on the new output; exporting keys to Cake or Feather doesn't.
- Label the network. Test builds say testnet everywhere, and test coins have no value.
- Surface refusals plainly: the price moved, no watchtower online, price impact above the limit. Each one means nothing was sent.
What your users trust
- The maker is paid only by revealing its half of the key, and that hands your user the XMR.
- No switch can stop a claim or a refund.
- No third-party audit yet; the core escrow logic is model-checked. Details in Security and trust.