Developer documentation

Ellyptic

A vault contract holds the funds. A separate SPHINCS+ key authorizes spending. Context stores the preferences you want Trade and your agents to use.

99901 · Elysium MainnetRead balances and get quotes

Open Trade. Quotes work without a wallet.

99901 · Elysium MainnetManage a vault

Connect an EVM wallet to create or recover a vault.

The verifier and vault contracts have not received an external audit.

Keys and recovery

Open the Vault tab to create or recover a vault. A Context workspace is optional and has its own recovery passphrase.

Workspace passphrase
Opens the dashboard and decrypts saved Context. The browser generates 256 random bits and displays them as grouped hexadecimal. Keep the whole phrase.
EVM wallet
Signs EVM transactions and pays gas. Its address has its own balance. The vault contract has a different address and balance.
Vault key pair
The browser derives an SLH-DSA key pair from the generated vault recovery phrase. The factory stores the 32-byte public key in the vault contract. The private key stays in browser memory while loaded. The public key is visible on-chain.

If your wallet key leaks

Someone with the EVM private key can spend funds held by that wallet. To spend funds held by the vault, they still need valid authorization under the registered SLH-DSA public key. The vault can receive a correctly signed action from any EVM sender, including your replacement wallet.

Save the vault address and its separate recovery phrase offline. The phrase derives the signing key. Anyone with the phrase can sign withdrawals and rotations. Public deposits, balances, swaps, and withdrawals are visible on-chain.

Vault contract

View the verified source and compiler settings on Sourcify for the Mainnet Vault Factory and SLH-DSA Verifier.

On Elysium Mainnet, MainnetVaultFactory.create(publicKey) deploys a contract for your key pair and emits VaultCreated. Use the contract address from that event for deposits and balance reads.

ActionAuthorizationEffect
Deposit HYPE or ERC-20Sender’s EVM transactionCredits the vault address.
WithdrawSPHINCS+ signature for the asset, amount, and recipientSends the signed asset and amount to that recipient.
SwapSPHINCS+ signature for the venue, pool, direction, input, and minimum outputExecutes through Montra’s router or the Uniswap v4 PoolManager. Output stays in the vault.
Rotate keySPHINCS+ signatures from both the current and replacement keysChanges the key at the same vault address.

Fetch publicKey() to read the registered key and nonce() to read the next action number. Use the zero address for native HYPE and a token’s contract address for ERC-20. Order and withdrawal amounts use base units.

Both execution paths use the selected on-chain pool. Montra pools settle in the Uniswap v4 PoolManager.

Solidity · mainnet contract interface
interface IQuantumVault {
    struct PoolKey {
        address currency0;
        address currency1;
        uint24 fee;
        int24 tickSpacing;
        address hooks;
    }
    struct SwapOrder {
        uint8 venue;
        PoolKey key;
        bool zeroForOne;
        uint128 amountIn;
        uint128 minOut;
    }
    function publicKey() external view returns (bytes32);
    function nonce() external view returns (uint256);

    function digest(uint8 operation, bytes32 params, uint256 deadline)
        external view returns (bytes32);
    function withdraw(address asset, address recipient, uint256 amount,
        uint256 deadline, bytes calldata signature) external;
    function swap(SwapOrder calldata order, uint256 deadline,
        bytes calldata signature) external returns (uint256);
    function rotate(bytes32 replacement, uint256 deadline,
        bytes calldata signature, bytes calldata replacementProof) external;
}

SPHINCS+ signing

Generate the key pair once per vault setup. Sign each spending action with the same private key. During an unlocked session the browser can sign when you confirm the action. Your EVM wallet confirms the transaction that submits it.

The verifier implements FIPS 205 SLH-DSA-SHA2-128s in pure mode with empty context and a 32-byte message. A signature is 7,856 bytes. The verifier reconstructs the FORS root, walks seven XMSS layers, and checks the resulting root against the public key.

Solidity · digest the vault verifies
sha256(abi.encode(
    "ELYSIUM-QUANTUM-VAULT-MAINNET/v1",
    block.chainid,
    address(this),
    nonce,
    operation,
    params,
    deadline
))

Operation 1 is withdrawal, 2 is swap, and 3 is rotation. The withdrawal params hash covers (address asset, address recipient, uint256 amount). The swap hash covers the entire SwapOrder. Both use keccak256(abi.encode(...)). Rotation puts the new public key directly in params. Every successful signed action advances the nonce, so a competing action signed at the same nonce must be signed again. The UI sets the deadline three minutes after the latest block timestamp.

JavaScript · submit a signed HYPE withdrawal
import { AbiCoder, ZeroAddress, getBytes, hexlify, keccak256, parseEther } from "ethers";
import { slh_dsa_sha2_128s as slh } from "@noble/post-quantum/slh-dsa.js";

export async function withdrawHype(vault, vaultSecretKey, recipient) {
  // vault is an ethers Contract connected to a mainnet EVM signer.
  const block = await vault.runner.provider.getBlock("latest");
  const amount = parseEther("0.1");
  const deadline = block.timestamp + 180;
  const params = keccak256(AbiCoder.defaultAbiCoder().encode(
    ["address", "address", "uint256"], [ZeroAddress, recipient, amount]
  ));
  const digest = await vault.digest(1, params, deadline);
  const signature = hexlify(slh.sign(getBytes(digest), vaultSecretKey));
  const tx = await vault.withdraw(ZeroAddress, recipient, amount, deadline, signature);
  return tx.wait();
}

NIST FIPS 205 · Browser verifier demo

Mainnet API

The mainnet endpoints read Elysium chain 99901. The wallet connection asks the browser wallet for an address. The API reads the address at a pinned block and uses no transaction signatures.

Use the relative URLs below on Ellyptic. The Mainnet API is public and read-only. Browser API requests with a supplied cross-origin Origin receive 403.

GET /api/mainnet/wallet

Pass an EVM address. The response contains chainId, the block number as a string, the checksummed address, and balances for HYPE, MONTRA, and KNTQ. Each entry has address, symbol, decimals, and a decimal string balance. A null balance means the read failed. Zero is returned as a decimal string.

Browser JavaScript · ask for an address and read balances
// Call from a user-initiated action on the Ellyptic origin.
const wallet = window.ethereum;
if (!wallet) throw new Error("Install an EVM wallet.");
const [address] = await wallet.request({ method: "eth_requestAccounts" });
if (!address) throw new Error("Select a wallet account.");
const query = new URLSearchParams({ address });
const response = await fetch("/api/mainnet/wallet?" + query);
const data = await response.json();
if (!response.ok) throw new Error(data.error);
console.table(data.balances);

GET /api/mainnet/quote

token
EVM contract address registered with a supported Montra market. Defaults to MONTRA.
side
buy spends the pool’s paired asset. sell spends the selected token.
amount
Positive decimal amount of the asset being spent. Use that asset’s precision.
Browser JavaScript · quote a 0.1 KNTQ buy for MONTRA
const params = new URLSearchParams({
  token: "0x063f7cc5339f92a5fd7baf3d22233044fda1f327",
  side: "buy",
  amount: "0.1"
});
const response = await fetch("/api/mainnet/quote?" + params);
const quote = await response.json();
if (!response.ok) throw new Error(quote.error);
console.log(quote.block, quote.poolId, quote.input.symbol, quote.output.symbol);
console.table(quote.quotes);

The response also includes chainId, amount, hook, and sharedPool. The input and output objects carry asset metadata. Each quotes entry contains source, the quoting contract, and output as a decimal string or null if that source failed. The Montra router and official Uniswap v4 Quoter read the same Montra pool at the same block. This API only quotes Montra pools.

Errors use {"error":"..."}. Expect 400 for invalid inputs, 405 for writes, 422 if a pool or quote is unavailable, and 503 for an RPC or registry failure.

Uniswap v4 deployment addresses

Context and Trade

Open Agents → Context library to save Preferences, Projects, or Knowledge. Trade reads selected slippage preferences from this library. External MCP clients read the entries you share through a grant or snapshot.

  1. Save a Preferences entry with one slippage line such as Max slippage: 0.5%. The bot’s Save and use action creates a private preference using the same format.
  2. In Trade, choose the saved preference under Context limit next to the quote. The selection applies to the current session.
  3. Enter a command such as buy 0.1 HYPE or sell 25%. The bot builds a draft. The review shows the minimum output and the saved limit used. A request above the selected cap is rejected.
  4. Review and confirm the order yourself. If the selected preference changes, prepare a fresh draft.

portfolio, wallet, track trade, and context are accepted commands in the test bot. The slippage parser accepts 0% through 5% with up to two decimal places. A 0.5% limit is 50 basis points, so a quote of 200 base units yields a minimum of 199 base units. The vault signs the minimum output, while the human-readable preference stays in Context.

Workspace API

The browser derives an authentication credential and an AES-256-GCM key with HKDF-SHA-256, using separate derivation labels. It sends the credential as X-QV-Workspace and stores encrypted Context as a Base64 {iv, data} envelope. D1 indexes records by a hash of the credential. The recovery passphrase and the Context encryption key stay in the browser.

Method and pathBodySuccess
POST /api/workspace{envelope}201 {revision: 0}
GET /api/workspace—200 {envelope, revision}
PUT /api/workspace{envelope, revision}200 {revision} after increment
GET /api/grants—200 {grants} of {id, name, expires}
POST /api/grants{id, name, envelope, revision}201 {id, expires}
DELETE /api/grants/{id}—204 with an empty body

expires is Unix time in milliseconds. Grant snapshots use a separate AES key derived from the grant secret. The grant ID here is the SHA-256 hash of the 64-character hexadecimal secret, hashed as text. The envelope’s additional authenticated data is mcp:<grant-id>.

JavaScript · workspace save using the project’s crypto helpers
import { seal, unseal, workspaceSecrets } from "./src/context-crypto.js";

export async function saveEntries(phrase, editEntries) {
  const { auth, key } = await workspaceSecrets(phrase);
  const path = "/api/workspace";
  const headers = { "X-QV-Workspace": auth };
  const scope = "quantum-vault:workspace:v1";
  const read = await fetch(path, { headers });
  if (!read.ok) throw new Error((await read.json()).error);
  const { revision, envelope } = await read.json();
  const current = await unseal(key, envelope, scope);
  const next = { version: 1, entries: editEntries(current.entries) };
  const write = await fetch(path, {
    method: "PUT",
    headers: { ...headers, "Content-Type": "application/json" },
    body: JSON.stringify({ revision, envelope: await seal(key, next, scope) })
  });
  if (!write.ok) throw new Error((await write.json()).error);
  return write.json();
}

Run this example from a client project that imports the repository helper, with an existing workspace. Each Context entry has id, title, content, category, and shareable. A stale revision returns 409. Read the latest workspace and review the merge before retrying. Saving or deleting a Context entry advances the revision and ends existing remote grants.

MCP clients

Remote grant

In Agents → Connections, select the shareable entries and create a grant. Configure a Streamable HTTP client with the endpoint /mcp and Authorization: Bearer qv_mcp_<secret>. The client also needs access to this private site.

Send JSON-RPC messages by POST. The server handles initialize, ping, tools/list, and tools/call. The single tool, read_context, takes an optional category of Preferences, Projects, or Knowledge. Parse the JSON in result.content[0].text to get {entries}. The tool can read the selected notes and has no transaction permissions.

JSON-RPC · read shared trading preferences
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "read_context",
    "arguments": { "category": "Preferences" }
  }
}
Browser JavaScript · send MCP JSON-RPC with a grant
export async function readSharedPreferences(authorization) {
  // Pass the full Authorization value copied from the grant screen.
  async function rpc(id, method, params) {
    const response = await fetch("/mcp", {
      method: "POST",
      headers: {
        "Authorization": authorization,
        "Content-Type": "application/json",
        "Accept": "application/json, text/event-stream"
      },
      body: JSON.stringify({ jsonrpc: "2.0", id, method, params })
    });
    const reply = await response.json();
    if (!response.ok) throw new Error(reply.error);
    if (reply.error) throw new Error(reply.error.message);
    return reply.result;
  }
  await rpc(1, "initialize", {
    protocolVersion: "2025-11-25",
    capabilities: {},
    clientInfo: { name: "vault-example", version: "1.0.0" }
  });
  const result = await rpc(2, "tools/call", {
    name: "read_context", arguments: { category: "Preferences" }
  });
  return JSON.parse(result.content[0].text).entries;
}

Grants expire after 24 hours. The server decrypts only the selected snapshot when a client presents the grant token. Revocation and workspace edits stop future reads. Copies already received may remain with the client.

Local stdio

Export a local snapshot of selected entries and download the adapter. Run it with Node.js 22 or later. The export is a readable JSON file. Control access through local file permissions and replace or remove the snapshot when needed.

JSON · local MCP client configuration
{
  "mcpServers": {
    "ellyptic": {
      "command": "node",
      "args": ["/absolute/path/context-mcp.mjs"],
      "env": {
        "QUANTUM_VAULT_CONTEXT_FILE": "/absolute/path/ellyptic-context.json"
      }
    }
  }
}