Skip to content

Developers · on npm

Post-quantum accounts for every EVM dApp.

Four packages that let any MetaMask user use your dApp on QoreChain, with an ML-DSA-87 root in control and MetaMask capped, scoped and revocable. Your wagmi code stays the same.
to integrate with wagmi

9lines

to integrate with wagmi

for a new MetaMask user

1signature

for a new MetaMask user

needed to start: sponsored

0QOR

needed to start: sponsored

Apache-2.0, typed, ESM + CJS

4packages

Apache-2.0, typed, ESM + CJS

How it fits

Four layers. Use one, or all of them.

The connector and the UI sit on the core engine in the browser. The relayer runs on your server and pays gas. The chain enforces every limit, so none of these layers has to be trusted with your users' funds.

Browser

Your dAppuseWriteContract · useReadContract
@rohankumar4179/core
MetaMask-signed call
hybrid envelope, gas paid

QoreChain

Diana testnetx/pqc · x/abstractaccount · EVM 9800

Which do I need?

I have a wagmi dApp and want MetaMask users on QoreChain

wagmireact

I am building a wallet, a dashboard or a non-wagmi app

corereact

I want to pay gas for my users, on my own server

relayer

I am giving an AI agent a capped budget

core

The packages

@rohankumar4179/*

Connector

@rohankumar4179/wagmi

Start here

Add QoreConnect to an existing dApp.

A wagmi connector and transport. MetaMask users get a quantum-safe QoreChain account; your hooks do not change.

  • ✓9-line integration
  • ✓useWriteContract and receipts work as before
  • ✓Listed in EIP-6963 wallet pickers
qoreConnectqoreTransportqorechainDiana
v0.1.0 · 12.4 kB · wagmi v2 · viemnpm ↗Source ↗

Interface

@rohankumar4179/react

Start here

The screens users trust.

Onboarding, the signing preview, contract approval and unlock, as React components. One provider, no CSS to import.

  • ✓~20 s onboarding with a passkey
  • ✓Decoded, simulated preview before MetaMask
  • ✓Honesty labels on every signature
createQoreConnectUIQoreConnectProviderSigningPreviewOnboardingModalApproveSheet
v0.1.0 · 67.8 kB · React 18+npm ↗Source ↗

Engine

@rohankumar4179/core

Keys, limits and the provider.

The post-quantum root vault, session keys with chain-enforced limits, the EIP-1193 provider, previews and agents.

  • ✓ML-DSA-87 root, passkey-encrypted
  • ✓Per-tx, daily and allow-list limits
  • ✓Q-Day kill switch in one transaction
RootVaultonboardAndLinkQoreConnectProviderbuildPreviewrevokeKeyscreateAgent
v0.1.0 · 223.8 kB · Browser or Nodenpm ↗Source ↗

Backend

@rohankumar4179/relayer

Pay your users’ gas. Self-hosted.

Relays MetaMask-signed calls, sponsors new accounts, runs gas tanks, and serves the Meter, Doctor and exposure report.

  • ✓Non-custodial: only relays what users signed
  • ✓Pre-checks before paying gas
  • ✓Gas tanks with per-user daily caps
createRelayerAppRelayServiceSponsorServiceRelayerStoreMeterIndexerrunDoctor
v0.1.0 · 81.5 kB · Node 22.5+npm ↗Source ↗

Quick start

From zero to a quantum-rooted dApp.

Three steps. After them, a MetaMask user who has never touched QoreChain can connect, onboard in about twenty seconds and transact, with no QOR in their wallet.

  1. 01

    Install

    The connector, the UI and wagmi v2.

    terminal
    npm install @rohankumar4179/wagmi @rohankumar4179/react wagmi@2 viem @tanstack/react-query
  2. 02

    Add the connector

    Point it at your contracts, your relayer and your gas tank.

    wagmi.ts
    import { createConfig } from 'wagmi'
    import { qoreConnect, qoreTransport, qorechainDiana } from '@rohankumar4179/wagmi'
    import { createQoreConnectUI } from '@rohankumar4179/react'
    
    export const ui = createQoreConnectUI()
    
    export const config = createConfig({
      chains: [qorechainDiana],
      connectors: [
        qoreConnect({
          appName: 'My dApp',
          contracts: ['0xYourContract'],      // what users approve for your dApp
          relayerUrl: 'https://your-relayer',  // a @rohankumar4179/relayer server
          gasTankId: 'my-dapp',                // pays your users' fees
          ui: ui.hooks,
        }),
      ],
      transports: { [qorechainDiana.id]: qoreTransport() },
    })
  3. 03

    Render the provider once

    Onboarding, approval and preview screens appear when they are needed.

    main.tsx
    import { QoreConnectProvider } from '@rohankumar4179/react'
    import { config, ui } from './wagmi'
    
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <QoreConnectProvider ui={ui}>
          <App />
        </QoreConnectProvider>
      </QueryClientProvider>
    </WagmiProvider>
  4. ✓

    Keep your code

    Every wagmi hook works as before. On chain, msg.sender is the user’s quantum-safe root.

    TipButton.tsx
    // Unchanged wagmi code. QoreConnect adds the preview, the limits and the gas.
    const { writeContract, data: hash } = useWriteContract()
    const { isSuccess } = useWaitForTransactionReceipt({ hash })
    
    writeContract({ address: TIPJAR, abi, functionName: 'tip', args: [creator, 'gm'], value: parseEther('0.1') })

Recipes

Beyond the connector.

The same packages power wallets, dashboards, agents and your own backend.

The whole first run, in one call

Create the root with a passkey, take one MetaMask signature, get the fee sponsored, register the ML-DSA-87 key and link MetaMask with limits. Idempotent: a failed attempt can simply be retried.

onboard.ts
import { DIANA, RootVault, WebAuthnPasskeyProvider, onboardAndLink, presetLimits, presetById } from '@rohankumar4179/core'

const result = await onboardAndLink({
  net: DIANA,
  vault: new RootVault(),
  protection: { kind: 'passkey', passkey: new WebAuthnPasskeyProvider({ name: 'My dApp' }) },
  metamask: window.ethereum,
  relayerUrl: 'https://your-relayer',
  contracts: ['0xYourContract'],
  limits: presetLimits(presetById('everyday')!),   // 1 QOR per tx, 5 QOR per day
  onEvent: (e) => console.log(e.step),             // creating → signing → sponsoring → registering → linking
})

console.log(result.root.qorAddress, result.ms + ' ms')

Why QoreConnect

What you would otherwise build.

QoreChain only accepts EVM transactions from accounts with a registered post-quantum key, and MetaMask cannot hold one.

CapabilityMetaMask aloneBuild it yourselfQoreConnect
MetaMask user can transact on QoreChainNo: no ML-DSA keyAfter weeks of workYes
Steps for a first transactionNot possibleMany1 passkey tap + 1 signature
User needs QOR for gasYesBuild a faucetNo: sponsored
Loss if the MetaMask key leaksEverythingDependsAt most the daily limit
Limits enforced byNobodyYour codeThe chain
What the user reads before signingA hex digestBuild itDecoded, simulated preview
Q-Day responseNoneBuild itRevoke all classical keys, 1 tx
Integration–Thousands of lines9 lines

Honest notes

What these packages do not claim

  • Testnet only. QoreChain Diana (EVM 9800); abstract accounts are off on mainnet.
  • MetaMask stays classical. Its key is capped, scoped and revocable, not quantum-safe. The root is.
  • wagmi v2. v3 builds a config with the connector but is not tested end to end yet.
  • Not audited. Use small amounts. Threat model ↗

See it running

Every package is live on Diana right now.

The demo dApp uses the connector and the UI, this site uses the core engine, and the public relayer is built on the relayer package.