@qorechain/connect
v0.2.1
Published
One universal wallet connector for QoreChain across all 3 VMs (EVM, Cosmos, SVM). Detects any wallet by its standard interface (EIP-1193, OfflineDirectSigner, Solana Wallet Standard) and auto-layers the FIPS-204 PQC signature only where the chain requires
Readme
@qorechain/connect
One component to connect any wallet to QoreChain across all three VMs.
It detects the wallet by the standard interface it exposes and routes the
transaction, auto-layering the FIPS-204 ML-DSA-87 signature only where the
chain requires it (Cosmos + SVM-execute) and skipping it on the PQC-exempt EVM
lane. Built on @qorechain/wallet-adapter.
import { QoreConnect } from '@qorechain/connect';
const vm = QoreConnect.detect(wallet); // 'evm' | 'cosmos' | 'svm'
await QoreConnect.send(wallet, { to, amount }); // routed + PQC where neededCoverage — top wallets per VM (all use a standard interface this routes)
| VM | Interface detected | Wallets |
|---|---|---|
| EVM | EIP-1193 / EIP-6963 (provider.request) | MetaMask · Trust · Coinbase · Rabby · OKX · Brave · Rainbow · Zerion · Frame · imToken |
| Cosmos | OfflineDirectSigner (signDirect) | Keplr · Leap · Cosmostation · Station · Compass · XDEFI · OWallet · Coin98 · Fox · Trust |
| SVM | Solana Wallet Standard (signAndSendTransaction) | Phantom · Solflare · Backpack · Glow · Coinbase · Exodus · OKX · Trust · Brave · Coin98 |
Because each wallet conforms to its VM's standard interface, the single connector covers all of them — no per-wallet code. Verified live: EVM tx mined; Cosmos PQC tx committed code 0 (ML-DSA accepted); SVM read OK.
PQC, automatically
- EVM → structurally PQC-exempt → wallet signs natively, no extra step.
- Cosmos → PQC-required → connector bakes the ML-DSA-87 extension into the body
before the wallet
signDirects it, so the wallet needs zero changes. - SVM → reads native;
tx svm executeis a cosmos tx → same PQC layer.
Hybrid sign-bytes form (v1 / v2, chain v3.2.0 / testnet v3.1.98)
The ML-DSA-87 signature covers one of two byte forms and a network accepts exactly
one at any height: v1 BE32(len B0) ‖ B0 ‖ BE32(len A) ‖ A, or v2, which prefixes
"qorechain-pqc-hybrid-v2" ‖ BE64(len chainId) ‖ chainId. qorechain-vladi
(mainnet) and qorechain-diana (testnet) verify v1 until the upgrade that carries
the switch is applied on them and v2 afterwards; testnet is on v2, mainnet stays
on v1 until its own upgrade. Other chains verify v2 from genesis. The switch
ships under two plan names — mainnet applies v3.2.0, the testnet already applied
v3.1.98 — and the resolver asks for both, so either one applied means v2.
await QoreConnect.sendCosmos(keplr, { address, pubkey, mlsk, acct, seq, to, amount,
chainId: 'qorechain-vladi', rpc, rest: lcdUrl /* or signBytesVersion: 'v1' | 'v2' */ });
// -> { vm:'cosmos', code, hash, pqc:true, signBytesVersion: 'v1' | 'v2' }signBytesVersion: 'auto' (default) asks rest (or QORE_REST) through
@qorechain/wallet-adapter's resolver and caches the answer for 60 s; on vladi /
diana without rest it throws instead of guessing. With 'auto', a refusal with
pqc code 21 re-resolves once and, if the answer changed, re-signs and broadcasts
once more. Explicit 'v1' / 'v2' never retries.
License
Apache-2.0
