KCC20 SDKArgent compiler

sdkVersion 168 · argent.js 1.3.0 · silverscript.js 1.0.0-rc1

Argent vault compiler

Argent is the vault agent inside KCC20 Wallet. It is not a hosted XMSS compiler and it does not hold keys.

LayerWhat it actually does
Local parserwallet/js/intent.js — same rules as argent.js here
Optional remote/kccApi { action:'chat', agent:'argent' } merged into local parse
CompilerbuildCovenant in the PWA → kaspa:p P2SH via rusty-kaspa WASM
This SDKParse + LLM director prompt + compileVault RPC. No keys, no opcodes.
Nilla-style LLMDirects Argent. Does not compile. User PIN-signs.
Time Capsule returns to the owner. “Send to my grandson” is a plain send unless they say dead-man / heir.

LLM directs Argent. Argent compiles.

User: “I want to send Kaspa to my grandson.”
  → your LLM (or argent.direct locally)
  → ArgentIntent JSON
  → kcc.compileVault({ type, params })   // vaults, kaspa:p
     or kcc.sendKas({ dest, amount })    // plain send, kaspa:q
  → PWA Argent compiles / builds
  → user Approves + PIN
  → { address, txId }

Same money model as Nilla Gorilla: you (or Argent) build, they sign. Difference: for vaults you do not assemble the redeem script. Argent does.

Grandson example (fact-checked)

Local parser: send + no kaspa: address → type send, missing amount + destination. It will not invent a dead-man vault.

They meanTypeWallet call
Pay him nowsendsendKas({ dest, amount })
If I miss check-ins / when I diesentinelcompileVault — timeout pays beneficiary
Lock until a date, then I sendtimelock / lifeUnlocks to you, then sendKas
He claims with a secrethashlockreceiver = his kaspa:q
Post-quantum lockxmssPublic kit from xmss_keygen.py only

In-app sentinel is Schnorr + CLTV hops shaped like covenants/sentinel. Full XMSS sentinel is the repo CLI. Do not tell the user a Time Capsule pays the grandchild.

Intent types Argent can compile

  • send — not a vault. Native KAS to kaspa:q.
  • timelock — Time Capsule. Returns to owner.
  • life — rent / car / save / spend / control. Unlock-anytime = owner envelope.
  • escrow — seller refunds; buyer claims if that chip is in this PWA.
  • multisig — 2-of-2, both keys on this device to Sweep.
  • kcc20lock — freeze a KCC20 bag.
  • sentinel — dead-man. Aliases: deadman, dead man switch, dms. beneficiary gets timeout. Never compiled as Time Capsule.
  • recurring — check-in pays payee.
  • hashlock — secret or refund.
  • xmss — real post-quantum vault from this GitHub repo. Public kit only.

Install

script src="https://kcc-20-wallet.vercel.app/sdk.js?v=168"

script src="https://kcc20-sdk.vercel.app/argent.js"

const argent = window.kcc20Argent;
const directed = argent.direct(userText);
if (!directed.complete) ask(directed.ask);
else {
  await kcc.connect(); // click
  const r = directed.plan.method === 'sendKas'
    ? await kcc.sendKas(directed.plan.payload)
    : await kcc.compileVault(directed.plan.payload);
}

Parse is local. Compile opens the PWA. Require kcc.sdkVersion >= "168".

compileVault / sendKas

await kcc.compileVault({ type, amount, params, message? }) → { address, txId, type, name }

Always pass a real amount or amountKas (KAS). The wallet will not lock “an amount”. seniorguardian maps to sentinel. Weekly cap: type: 'spendlimit', amount: 50, params: { capKas: 10, period: 'weekly' }.

await kcc.compileVaults({ vaults: [{ type, amount, params }, …] }) → { argent: 2, txId, vaults[] }

Argent 2 — one transaction, many P2SH outputs. Argent 1 (compileVault) stays one-at-a-time. SilverScript v1.0.0 templates attach for spend-limit / N:M; paste a silverc artifact to fund the real bytecode.

Wallet Argent compiles the P2SH, user Approves, PIN funds it. Result address starts with kaspa:p.

await kcc.sendKas({ dest, amount }) → { txId, dest, amountKas }

Plain transfer. dest is a full kaspa:q, not kaspa:p.

Pass message instead of a typed intent and the wallet parser fills the fields (same as the Argent orb). Incomplete intents throw with the same askFor string the orb uses.

Deep-link (no RPC): https://kcc-20-wallet.vercel.app/?tab=vault&argent=lock%2010%20kas%20for%207%20days

Create your own Argent

  1. Load argent.js. Reuse parseIntent / direct / askFor.
  2. Optional: sit any LLM in front with argent.llmDirectorPrompt().
  3. On a user click, call compileVault or sendKas. Do not compile scripts on your server. Do not ask for keys.
  4. XMSS offline: python3 keygen/xmss_keygen.py then fund via the PWA or covenants/xmsslock CLI.

Full notes: ARGENT.md · repo kaspa-xmss-covenants.

Repo map

TypePWA functionGitHub
timelock / lifebuildTimelockCovenantanalog of covenants/time_capsule
sentinelbuildSentinelChain (Schnorr analog)shape of covenants/sentinel
recurringbuildRecurringChainx402-kaspa/sentinel-x402
xmssfund public kit P2SHcovenants/xmsslock + keygen/

Node CLI uses @onekeyfe/kaspa-wasm (Node only). Browser uses rusty-kaspa web WASM. Do not mix.

Try parse (local, no keys)

Open argent-demo

Or in this page’s console: kcc20Argent.direct('I want to send Kaspa to my grandson.')