Kaspa Vault

Run your own

Everything here is open source (MIT). Use this site, or run the whole thing yourself: three paths, pick one.

1. Put a vault on your website

One file and one tag. Download kaspa-vault.min.js from a release (or build it, see Verify), host it next to your page, and add:

<script type="module" src="/kaspa-vault.min.js"></script>
<kaspa-vault
    watcher="https://watch.kaspavault.com"
    guardian="45f27924281a099a68cc4d65c9a52aa1793a0c00e0c188ff0d09469f83826148">
</kaspa-vault>

Always set guardian: it pins the watcher's key, so if the watcher's server were ever swapped, your page refuses to create vaults instead of trusting the new key. Use any watcher from the list below, or your own. Colors follow CSS variables (--kv-accent, --kv-font…). Details: widget/README.md.

Recommended: serve the page with a strict Content-Security-Policy that allows only your watcher and the Kaspa API. This site's own _headers is a ready example.

2. Run a watcher

A watcher is what makes vaults safe to use: it emails owners and holds the one key that can rescue their vaults to their own backup wallets. More watchers, run by different people, make the whole system sturdier.

  1. A small Linux server with Node.js 18+, nginx and a domain name. 1 GB of memory is plenty.
  2. A Kaspa node of your own (best), or the public REST API as a fallback.
  3. A mail account of its own, for the alerts.
  4. Install and make the key: node gen-key.js. Back the key up offline in two places; it is what rescues vaults if the server dies.
  5. Check, run, publish: node node-check.js, then pm2, nginx and a certificate. Then do the mainnet drill with a few KAS.

The full guide: watcher/README.md. Each watcher has its own key, and a vault is bound to the watcher it was made with.

3. Put the vault in your wallet app

The core library builds vaults, transactions and signatures with no server and no compiler. Your wallet already has the user's key; the vault needs only its public half.

import { buildVault, makeCard, VaultClient, restProvider, keySigner } from 'kaspa-vault';

const pair = buildVault({ hot, guardian, rescue, delayDaa: '864000' });  // three public keys
const card = makeCard({ ...pair, watcher: { url: 'https://watch.kaspavault.com' } });    // the user's backup
const vault = new VaultClient(pair, { provider: restProvider() });

await vault.deposit({ signer, amount });   // wallet -> vault
await vault.withdraw({ signer });          // vault -> waiting room (the watcher emails)
await vault.release();                     // after the waiting time, no key needed

Register the vault with a watcher (POST /v1/register, signed by the vault's key) so the owner gets alerts. Until the npm package is published, import from the repository's core/. Details: core/README.md.

Watchers

WatcherRun byStatus
watch.kaspavault.com
key 45f27924281a099a…
Kaspero Labs

Running one? Open an issue with its URL and key to be listed here.