The wallet holds a NEAR Intents account beside its Quantus accounts and runs multi-leg routes through it: QTC in over the bridge, swapped through whichever venue pays most, paid out to any chain the user names; and the reverse, an external deposit turned into QTC on a Quantus account. One preview shows the whole route, each leg's quote, fees and worst case; execution is leg by leg and survives a restart.
This replaces the operator's ~/near scripts (intents.py, oneclick.py), where each leg is a separate command and a hand-run curl.
Facts the design rests on (2026-10-09)
QTC reaches NEAR as qtc.omft.near through the PoA bridge (bridge.chaindefuser.com), not Quantus's MPC fork. Each intents account has one permanent Quantus deposit address that takes repeated deposits; the minimum is 0.01 QTC. Withdrawal back to Quantus costs 0.002 QTC.
1Click lists QTC but no solver quotes it. QTC liquidity is in unwhitelisted Ref DCL pools (dclv2.ref-labs.near, mainly QTC/wNEAR 1%), reached by an ft_withdraw to the pool with a Swap message whose client_echo names the account to be paid. Whitelisted pools refuse with E407 and refund. For wNEAR to USDC, 1Click funded from the account usually beats the pools.
intents.near v0.4.5 (commit 16d04f6, head of main) verifies signed intents (execute_intents) only under classical schemes: nep413, erc191, tip191, raw_ed25519, webauthn, ton_connect, sep53; account keys are Ed25519, secp256k1 or P-256. No branch or PR adds ML-DSA; feat/near-kit-update maps NEAR's MlDsa65 key to None/panic!.
NEAR itself has had ML-DSA-65 access keys on mainnet since protocol 85 (nearcore 2.13, NEP-645). intents.near also authorises plain transactions from the account that holds the balance: deposits, ft_withdraw/mt_withdraw, mt_transfer, key management. Every leg of the operator's route is one of these. Only solver-settled token_diff intents strictly need the classical signature.
PQ implicit accounts (NEP-655) and the ml_dsa_verify host function arrive with protocol 87 (nearcore 2.14, on testnet now). Until then a PQ account is a named account someone funds.
NEAR derives ML-DSA-65 at m/44'/397'/… (NEP-649, proposal), so the NEAR key is a separate derivation from the same phrase, not a reused Quantus key.
Signer decision
The wallet's rule is that it never holds a classical key. Whether that survives this epic depends on the first child: if an ML-DSA-65 NEAR account can run the whole route on mainnet, the intents account is PQ and the classical key is only an import (the operator's existing key.json) and an option for solver-settled swaps. If it cannot, the account is ed25519 derived from the wallet's phrase, labelled as a classical-key transit account; the operator has accepted that fallback. #7 (1Click deposit addresses, no account) stays open as the no-account route.
Operator-owned decisions
Funding for the spike: wNEAR in the operator's existing intents account (~/.config/qtc-direct/key.json). Given 2026-10-09.
Which NEAR RPC the wallet's users read (our own endpoint vs public RPCs with fallbacks).
Definition of done
From the wallet, with no script: deposit QTC from a Quantus account into the intents account, swap it to wNEAR through the best route, swap that to USDC, and pay the USDC out to an Ethereum address, from one previewed route that resumes after an app restart. The reverse (USDC deposited from outside, ending as QTC on a Quantus account) works the same way.
## Goal
The wallet holds a NEAR Intents account beside its Quantus accounts and runs multi-leg routes through it: QTC in over the bridge, swapped through whichever venue pays most, paid out to any chain the user names; and the reverse, an external deposit turned into QTC on a Quantus account. One preview shows the whole route, each leg's quote, fees and worst case; execution is leg by leg and survives a restart.
This replaces the operator's `~/near` scripts (`intents.py`, `oneclick.py`), where each leg is a separate command and a hand-run `curl`.
## Facts the design rests on (2026-10-09)
- QTC reaches NEAR as `qtc.omft.near` through the PoA bridge (`bridge.chaindefuser.com`), not Quantus's MPC fork. Each intents account has one permanent Quantus deposit address that takes repeated deposits; the minimum is 0.01 QTC. Withdrawal back to Quantus costs 0.002 QTC.
- 1Click lists QTC but no solver quotes it. QTC liquidity is in unwhitelisted Ref DCL pools (`dclv2.ref-labs.near`, mainly QTC/wNEAR 1%), reached by an `ft_withdraw` to the pool with a `Swap` message whose `client_echo` names the account to be paid. Whitelisted pools refuse with `E407` and refund. For wNEAR to USDC, 1Click funded from the account usually beats the pools.
- `intents.near` v0.4.5 (commit 16d04f6, head of `main`) verifies signed intents (`execute_intents`) only under classical schemes: nep413, erc191, tip191, raw_ed25519, webauthn, ton_connect, sep53; account keys are Ed25519, secp256k1 or P-256. No branch or PR adds ML-DSA; `feat/near-kit-update` maps NEAR's `MlDsa65` key to `None`/`panic!`.
- NEAR itself has had ML-DSA-65 access keys on mainnet since protocol 85 (nearcore 2.13, NEP-645). `intents.near` also authorises plain transactions from the account that holds the balance: deposits, `ft_withdraw`/`mt_withdraw`, `mt_transfer`, key management. Every leg of the operator's route is one of these. Only solver-settled `token_diff` intents strictly need the classical signature.
- PQ implicit accounts (NEP-655) and the `ml_dsa_verify` host function arrive with protocol 87 (nearcore 2.14, on testnet now). Until then a PQ account is a named account someone funds.
- NEAR derives ML-DSA-65 at `m/44'/397'/…` (NEP-649, proposal), so the NEAR key is a separate derivation from the same phrase, not a reused Quantus key.
## Signer decision
The wallet's rule is that it never holds a classical key. Whether that survives this epic depends on the first child: if an ML-DSA-65 NEAR account can run the whole route on mainnet, the intents account is PQ and the classical key is only an import (the operator's existing `key.json`) and an option for solver-settled swaps. If it cannot, the account is ed25519 derived from the wallet's phrase, labelled as a classical-key transit account; the operator has accepted that fallback. #7 (1Click deposit addresses, no account) stays open as the no-account route.
## Operator-owned decisions
- Funding for the spike: wNEAR in the operator's existing intents account (`~/.config/qtc-direct/key.json`). **Given 2026-10-09.**
- Which NEAR RPC the wallet's users read (our own endpoint vs public RPCs with fallbacks).
## Definition of done
From the wallet, with no script: deposit QTC from a Quantus account into the intents account, swap it to wNEAR through the best route, swap that to USDC, and pay the USDC out to an Ethereum address, from one previewed route that resumes after an app restart. The reverse (USDC deposited from outside, ending as QTC on a Quantus account) works the same way.
#75–#77 can proceed in parallel once #74 lands; #80 needs only #74.
Children in dependency order:
1. #72 spike: an ML-DSA-65 NEAR account runs the whole route on mainnet (decides the signer)
2. #73 near rpc for the wallet, off the mesh
3. #74 the intents account beside the quantus accounts
4. #75 bridge legs, qtc in and out
5. #76 swap legs, pools and 1click side by side
6. #77 cash-out to another chain, ranked
7. #78 routes: one preview, leg by leg, resumed
8. #79 on-ramp direction
9. #80 history from blackbeard.observer
#75–#77 can proceed in parallel once #74 lands; #80 needs only #74.
Signer decided by #72: the intents account is a NEAR account whose only key is ML-DSA-65, and the wallet still holds no classical key. Every leg of the route works through direct calls to intents.near, wrap.near and the bridge; nothing needs execute_intents.
Ed25519 remains an import option for an existing intents key (the operator's key.json). Using one is opt-in and labelled; it is never the default.
Consequences for the children, from #72's findings:
#73: the NEAR RPC must accept roughly 5.6 kB transactions, and view_access_key takes the ml-dsa-65-hash: form of the key.
a NEAR-side ML-DSA-65 derivation, separate from Quantus and signed with the empty context; qp-rusty-crystals-dilithium with ctx = None is accepted;
a native NEAR gas float, shown to the user and topped up by unwrapping wNEAR. A 300 Tgas call needs about 0.3 NEAR on hand, though it costs about 0.002;
account creation needs a sponsor until NEP-655's PQ implicit accounts reach mainnet (protocol 87). Until then this child decides who funds the creation: a named account created through the registrar with a temporary key, as #72 did, or a sponsor we run.
#76: the pool leg is a direct ft_withdraw with the Swap msg at 250 Tgas. The 1Click leg is a direct mt_transfer to the quote's deposit account.
#77: the same mt_transfer with recipientType: DESTINATION_CHAIN.
#79: deposits on someone else's behalf work as ft_transfer_call with msg = the receiving account.
Signer decided by #72: **the intents account is a NEAR account whose only key is ML-DSA-65**, and the wallet still holds no classical key. Every leg of the route works through direct calls to `intents.near`, `wrap.near` and the bridge; nothing needs `execute_intents`.
Ed25519 remains an import option for an existing intents key (the operator's `key.json`). Using one is opt-in and labelled; it is never the default.
Consequences for the children, from #72's findings:
- #73: the NEAR RPC must accept roughly 5.6 kB transactions, and `view_access_key` takes the `ml-dsa-65-hash:` form of the key.
- #74:
- a NEAR-side ML-DSA-65 derivation, separate from Quantus and signed with the **empty** context; `qp-rusty-crystals-dilithium` with `ctx = None` is accepted;
- a native NEAR gas float, shown to the user and topped up by unwrapping wNEAR. A 300 Tgas call needs about 0.3 NEAR on hand, though it costs about 0.002;
- account creation needs a sponsor until NEP-655's PQ implicit accounts reach mainnet (protocol 87). Until then this child decides who funds the creation: a named account created through the registrar with a temporary key, as #72 did, or a sponsor we run.
- #76: the pool leg is a direct `ft_withdraw` with the `Swap` msg at 250 Tgas. The 1Click leg is a direct `mt_transfer` to the quote's deposit account.
- #77: the same `mt_transfer` with `recipientType: DESTINATION_CHAIN`.
- #79: deposits on someone else's behalf work as `ft_transfer_call` with `msg` = the receiving account.
Two children added after the operator's decision on account creation (2026-10-09):
#81: the sponsor. blackbeard-observer.near creates each wallet's account as b<…>.blackbeard-observer.near, named from its key, with a gas float, through a service on blackbeard.observer's API.
#82: the swap fee that pays for it, at or below the official Quantus wallet's 0.5%. It goes through appFees on 1Click legs and an atomic mt_transfer on pool legs.
#74 derives the name and reads the account; creation goes through #81.
Two children added after the operator's decision on account creation (2026-10-09):
- #81: the sponsor. `blackbeard-observer.near` creates each wallet's account as `b<…>.blackbeard-observer.near`, named from its key, with a gas float, through a service on blackbeard.observer's API.
- #82: the swap fee that pays for it, at or below the official Quantus wallet's 0.5%. It goes through `appFees` on 1Click legs and an atomic `mt_transfer` on pool legs.
#74 derives the name and reads the account; creation goes through #81.
Operator decision, 2026-10-09: one intents account per installation, not one per wallet. A person has no use for several, so the wallet makes one and never offers a second. Every swap routes through it, whichever wallet's QTC goes in or out. The sponsor does not need to enforce this server-side.
Settings record the account (owning wallet, account id, public key).
Restore or a new machine: the wallet finds an existing sponsored account for an open phrase wallet and adopts it.
Creation asks which phrase wallet will own the account, and is refused once one exists.
Deposits come from any of the person's Quantus accounts.
Withdrawals and cash-outs pay any open wallet's account. They are signed by the owning wallet's key, so that wallet must be unlocked to move anything; balances read without it.
Operator decision, 2026-10-09: **one intents account per installation**, not one per wallet. A person has no use for several, so the wallet makes one and never offers a second. Every swap routes through it, whichever wallet's QTC goes in or out. The sponsor does not need to enforce this server-side.
Implemented in 4b407de:
- **Settings** record the account (owning wallet, account id, public key).
- **Restore or a new machine:** the wallet finds an existing sponsored account for an open phrase wallet and adopts it.
- **Creation** asks which phrase wallet will own the account, and is refused once one exists.
- **Deposits** come from any of the person's Quantus accounts.
- **Withdrawals and cash-outs** pay any open wallet's account. They are signed by the owning wallet's key, so that wallet must be unlocked to move anything; balances read without it.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
The wallet holds a NEAR Intents account beside its Quantus accounts and runs multi-leg routes through it: QTC in over the bridge, swapped through whichever venue pays most, paid out to any chain the user names; and the reverse, an external deposit turned into QTC on a Quantus account. One preview shows the whole route, each leg's quote, fees and worst case; execution is leg by leg and survives a restart.
This replaces the operator's
~/nearscripts (intents.py,oneclick.py), where each leg is a separate command and a hand-runcurl.Facts the design rests on (2026-10-09)
qtc.omft.nearthrough the PoA bridge (bridge.chaindefuser.com), not Quantus's MPC fork. Each intents account has one permanent Quantus deposit address that takes repeated deposits; the minimum is 0.01 QTC. Withdrawal back to Quantus costs 0.002 QTC.dclv2.ref-labs.near, mainly QTC/wNEAR 1%), reached by anft_withdrawto the pool with aSwapmessage whoseclient_echonames the account to be paid. Whitelisted pools refuse withE407and refund. For wNEAR to USDC, 1Click funded from the account usually beats the pools.intents.nearv0.4.5 (commit 16d04f6, head ofmain) verifies signed intents (execute_intents) only under classical schemes: nep413, erc191, tip191, raw_ed25519, webauthn, ton_connect, sep53; account keys are Ed25519, secp256k1 or P-256. No branch or PR adds ML-DSA;feat/near-kit-updatemaps NEAR'sMlDsa65key toNone/panic!.intents.nearalso authorises plain transactions from the account that holds the balance: deposits,ft_withdraw/mt_withdraw,mt_transfer, key management. Every leg of the operator's route is one of these. Only solver-settledtoken_diffintents strictly need the classical signature.ml_dsa_verifyhost function arrive with protocol 87 (nearcore 2.14, on testnet now). Until then a PQ account is a named account someone funds.m/44'/397'/…(NEP-649, proposal), so the NEAR key is a separate derivation from the same phrase, not a reused Quantus key.Signer decision
The wallet's rule is that it never holds a classical key. Whether that survives this epic depends on the first child: if an ML-DSA-65 NEAR account can run the whole route on mainnet, the intents account is PQ and the classical key is only an import (the operator's existing
key.json) and an option for solver-settled swaps. If it cannot, the account is ed25519 derived from the wallet's phrase, labelled as a classical-key transit account; the operator has accepted that fallback. #7 (1Click deposit addresses, no account) stays open as the no-account route.Operator-owned decisions
~/.config/qtc-direct/key.json). Given 2026-10-09.Definition of done
From the wallet, with no script: deposit QTC from a Quantus account into the intents account, swap it to wNEAR through the best route, swap that to USDC, and pay the USDC out to an Ethereum address, from one previewed route that resumes after an app restart. The reverse (USDC deposited from outside, ending as QTC on a Quantus account) works the same way.
Children in dependency order:
#75–#77 can proceed in parallel once #74 lands; #80 needs only #74.
Signer decided by #72: the intents account is a NEAR account whose only key is ML-DSA-65, and the wallet still holds no classical key. Every leg of the route works through direct calls to
intents.near,wrap.nearand the bridge; nothing needsexecute_intents.Ed25519 remains an import option for an existing intents key (the operator's
key.json). Using one is opt-in and labelled; it is never the default.Consequences for the children, from #72's findings:
view_access_keytakes theml-dsa-65-hash:form of the key.qp-rusty-crystals-dilithiumwithctx = Noneis accepted;ft_withdrawwith theSwapmsg at 250 Tgas. The 1Click leg is a directmt_transferto the quote's deposit account.mt_transferwithrecipientType: DESTINATION_CHAIN.ft_transfer_callwithmsg= the receiving account.Two children added after the operator's decision on account creation (2026-10-09):
blackbeard-observer.nearcreates each wallet's account asb<…>.blackbeard-observer.near, named from its key, with a gas float, through a service on blackbeard.observer's API.appFeeson 1Click legs and an atomicmt_transferon pool legs.#74 derives the name and reads the account; creation goes through #81.
Operator decision, 2026-10-09: one intents account per installation, not one per wallet. A person has no use for several, so the wallet makes one and never offers a second. Every swap routes through it, whichever wallet's QTC goes in or out. The sponsor does not need to enforce this server-side.
Implemented in
4b407de: