HESTIAdocs

Installation & setup

Install @hestia/sdk, understand its peer dependencies, and host the proving artifacts the SDK needs.


@hestia/sdk is the one package an agent needs. It bundles key management, note discovery, coin selection, client-side proving, and submission. It runs in Node and the browser from the same entry point.

Install

bash
npm install @hestia/sdk viem
  • viem (^2.51) is the chain client the SDK builds on. You'll use its types (Address, Chain, Account) and helpers (parseUnits, http, custom) alongside the SDK.
  • The SDK depends on @hestia/common, @hestia/circuits, and @hestia/route, which install transitively.

ESM only. The package is "type": "module" with a single export. Use it from an ESM project (Next.js, modern Node). The entry point is browser-safe — it contains no Node-only imports — which is what lets it bundle into a client app for in-browser proving.

What you import

ts
import {
  Hestia,
  AssociationSet,
  createHestiaTools,
  InsufficientPrivateBalance,
  deriveKeysFromSeed,
  deriveKeysFromSignature,
  encodeMetaAddress,
  decodeMetaAddress,
  NATIVE_ETH,
  USDC_ADDRESS,
  SDK_VERSION,
} from "@hestia/sdk";

The key-derivation and meta-address helpers, plus the NATIVE_ETH / USDC_ADDRESS constants, are re-exported from @hestia/common so you don't need a second import.

Proving artifacts

Proving happens on the device, which means the SDK needs each circuit's wasm + zkey. You provide their locations through the artifacts map; the SDK loads them at prove time.

ts
import type { ArtifactsByArity } from "@hestia/sdk";

// Node: filesystem paths.  Browser: URLs.
const artifacts: ArtifactsByArity = {
  "1x2": { wasm: "/circuits/transaction1x2.wasm", zkey: "/circuits/transaction1x2.zkey" },
  "2x2": { wasm: "/circuits/transaction2x2.wasm", zkey: "/circuits/transaction2x2.zkey" },
};

Practical notes:

  • The artifacts are large — the wasm is a few MB and each zkey is tens of MB. In the browser, serve them as static files (the Labs console serves them from /circuits) or from a CDN; the browser fetches and caches them.
  • In Node, point at the files on disk.
  • These are the development-ceremony artifacts. They are safe for testnet and local use, not for mainnet value — see circuits.

Two runtime profiles

The same SDK is configured slightly differently depending on where it runs — both are covered in The Hestia client:

Node (server / bot)Browser (console / dApp)
accountan Account from privateKeyToAccount(...)the connected Address
transportomit (defaults to http(rpcUrl))custom(window.ethereum)
signingthe in-process key signsthe user's wallet signs
artifactsfilesystem pathsURLs under /circuits

Once installed, head to the quickstart to make a private transfer.