Documentation
Overview
KORE is four contracts on Elysium (chain id 99901, gas paid in HYPE). The vault holds USDC and issues kUSD against it 1:1. Two shielded pools, one for kUSD and one for wrapped HYPE, take fixed amounts under one-time keys and pay them out against ring signatures, which hides which deposit a withdrawal comes from. The dark pool trades kUSD against HYPE in sealed batches funded from those pools.
This website is a front end to those contracts plus an optional relayer. It holds no funds and keeps no ledger. Every figure it shows is read from the chain.
| Vault | … |
| kUSD | … |
| kUSD pool | … |
| HYPE pool | … |
| Dark pool | … |
| USDC | … |
| Toll address | … |
Contracts
KoreVault has three functions that change state:
mint(amount, to)pullsamountUSDC from the caller and mints the same amount of kUSD toto.redeem(amount, to)burnsamountkUSD from the caller and sendsamountless 0.30% in USDC toto.sweep()sendsusdc.balanceOf(vault) - kusd.totalSupply()to the toll address. It reverts when that difference is zero.
There is no owner, admin, pause, freeze, fee setter, upgrade proxy or rescue function. redeem and sweep both end with require(usdc.balanceOf(vault) >= kusd.totalSupply()).
KUSD is a standard ERC-20 with 6 decimals. Its mint and burn accept calls from the vault only, and the vault is the contract that created it.
KorePool is deployed twice, for kUSD and for wrapped HYPE. It has two functions that change state, deposit and withdraw, described below, and no owner.
KoreDark has five: place, reveal, settle, payout and reclaim. It has no owner, no price feed and no fee setting.
The shielded pool
kUSD deposits come in four sizes: 10, 100, 1,000 and 10,000. HYPE deposits come in four sizes too: 0.1, 1, 10 and 100, held as wrapped HYPE. Each size has its own sequence of rings, and a ring closes when it holds 16 deposits.
- Deposit. Your browser picks a random secret
xand sends the public keyP = x·Gon alt_bn128 with the kUSD. The contract appendsPto the open ring. - Withdraw. You sign the message
keccak(chainId, pool, denom, ringId, k, to, relayer, fee, memo)with a linkable ring signature (LSAG) over the firstkkeys of the ring. The contract recomputes the signature with the curve precompiles at addresses0x06and0x07and paysto. - Key image. The signature includes
I = x·H, whereHis a point derived from the ring's id. The same deposit always gives the sameI, the contract records it, and a second withdrawal with that image reverts.
What an observer learns from a withdrawal is that it spends one of the k deposits in that ring. A full ring gives 1 in 16. Claiming from a ring that holds few deposits gives less cover, and a ring of one gives none; the app shows the count before you sign. A full ring-of-16 withdrawal costs about 650,000 gas.
What is public: mints, redeems, deposits into the pool, and the recipient and time of each withdrawal.
The dark pool
A sealed-bid batch auction between kUSD and HYPE. Time is cut into batches of a fixed length, set at deployment and shown in the app.
- Place (batch
b). You fund an order with a sealed note. The pool's ring signature covers the dark pool as recipient and amemoequal to your order's commitment,keccak(limit, recipient, salt), so nobody can attach your funds to a different order. Only the dark pool itself can execute a withdrawal that carries a memo. - Reveal (batch
b + 1). You open the commitment by publishing the limit price, the recipient and the salt. - Settle (from batch
b + 2). Anyone callssettle. For each revealed limit the contract works out how much HYPE would trade at that price and takes the price that trades the most; if several tie, it takes the midpoint of the lowest and highest. Buys at or above the price and sells at or below it are filled at that one price, and the larger side is filled pro rata. - Pay out. Anyone calls
payoutfor an order. Proceeds and any unfilled remainder go to the order's recipient.
Prices are quoted in kUSD per HYPE. A batch holds at most 24 orders per side. The dark pool charges nothing itself: the note pays the usual 0.30% pool toll as it leaves the shielded pool.
What is public: the side, lot size and batch of every order when it is placed; every revealed limit, the clearing price and the payout addresses after the batch closes. What is not: who funded an order, and its price while the batch is open.
An order that is not revealed in its window takes no part in the auction. Its owner can take it back with reclaim, which needs the same secret and keeps 1% for the toll address. The penalty exists because a trader who could walk away for free after seeing the other reveals would get a free look at the batch.
Notes and pay links
A note is the secret x as text: kore-note- followed by 64 hex characters. It is generated in your browser, stored in this browser's local storage, and never sent to the server. A pay link is the app address with the note after the #, which browsers do not transmit.
Whoever holds a note can claim the deposit, once, to any address. Give someone a note and you have paid them. Lose it and the deposit stays in the pool for good.
Payroll
KoreRouter seals many notes in one transaction. It has two functions:
payFromUsdc(denoms, xs, ys)pulls the total in USDC from the caller, mints kUSD through the vault and calls the pool'sdepositonce per key.payFromKusd(denoms, xs, ys)does the same starting from kUSD the caller already holds.
Each entry is one note: a lot size and the public key of a secret made in the payer's browser. A run holds 1 to 32 notes; 32 notes cost about 3.6 million gas. If any entry is invalid the whole call reverts and nothing is taken. The router has no owner, no pause and no withdraw function, and its token balances are zero outside a call.
What the chain shows: the payer's address, the total, and the number of notes of each size. What it does not show: who each note was for, or which later claim spends which note. A payee who claims several notes to one address reveals their own total, so separate addresses or spaced-out claims keep more hidden.
Tolls
| Mint | none |
| Seal (pool deposit) | none |
| Redeem | 0.30% in USDC, left in the vault as surplus until sweep |
| Claim (pool withdrawal) | 0.30% of the denomination in kUSD, sent to the toll address |
| Dark pool order | none beyond the 0.30% pool toll on the note that funds it |
| Unrevealed order | 1% of the order when it is reclaimed |
| Relayer | a flat fee in kUSD shown in the app, paid only when you use it |
The toll address is set in every constructor and cannot be changed. It is the budget for buying $KORE on the market and burning it, and its balance and transactions are visible on the explorer. $KORE carries no claim on the vault's USDC.
API
GET /api/config chain id, RPC, explorer, contract addresses, relayer address and fee
GET /api/stats reserves, supply, backing, tolls, sealed value, open ring per denomination
POST /api/relay { asset, denom, ringId, k, to, fee, c0, s[], image[2] } -> { tx }
POST /api/dark/place { buy, denom, ringId, k, fee, c0, s[], image[2], commitment } -> { tx }
POST /api/dark/reveal { id, limit, recipient, salt } -> { tx }
POST /api/dark/reclaim { id, limit, recipient, salt } -> { tx }
Amounts are strings in base units (6 decimals for kUSD, 18 for HYPE). When a relayer key is set the server also settles finished batches and pays out revealed orders; both calls are open to anyone. The relayer checks the withdrawal against the pool first and returns the pool's own revert reason if it would fail. It cannot alter the recipient or the fee, because both are inside the signed message.
Run it yourself
npm install npm run build # compiles the contracts with Foundry npm test # 120 checks: ring signatures, vault and pools, dark pool, on a local chain npm run dev # local chain, contracts, relayer and this site on :8350
You never need this site to use KORE. Every function above can be called from a block explorer or a script, and client/lsag.js is the complete signing code.
Risks
- The contracts are open source and tested but have not had an independent audit yet. A bug could lose funds.
- Privacy depends on the other deposits in your ring. Few deposits means little cover.
- A lost note cannot be recovered by anyone.
- kUSD is only as sound as USDC. If USDC lost its peg, or its issuer froze the vault's balance, kUSD would follow.
- The dark pool has no market maker. An order only fills if the other side shows up in the same batch at a compatible price; otherwise it is returned.
- A dark pool order must be opened in the batch after it was placed. Miss the window and reclaiming it costs 1%.
- The relayer can refuse to send a claim. It cannot take or redirect one, and you can always claim from your own wallet.