Sphere SDK
Identity, wallets, private communication, and peer-to-peer settlement for autonomous economic agents.
- Source repo
- unicity-sphere/sphere-sdk
- Stars
- ★ 5.4k
- Last updated
- 20d ago v0.8.0
- FARS reviewed
- Nov 08, 2026
- License
- MIT
- Primary language
- TypeScript
- FA score
- 71/100 · Some gaps
At a glance
- How it runs
- Works with
- Universal · cross-platform
- Cost
- Free, no paid service needed
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- A browser-wallet or dApp team can combine localStorage or IndexedDB with
ConnectClient/ConnectHostand the Sphere extension or popup flow. - Not a fit if
- Teams that need fully self-custodied token inventory — the wallet-api backend holds it
- Teams needing working mainnet or dev transfers now — v1 gateways fail with AGGREGATOR_ERROR
- Projects wanting zero-config setup — you must supply a gateway API key and wallet-api deployment
- Website
- unicity.ai ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-13latest release v0.8.0 (2026-05-29)
- Source review
- 71/100 · Some gaps
What does this agent do, and when should you use it?
Sphere SDK is a modular TypeScript wallet SDK for the Unicity state transition network, with documented browser and Node.js implementations. Its Sphere entry point composes identity, payments, payment requests, market intents, Nostr direct messages, and NIP-29 group chat. Wallet keys remain on the client, while the wallet-api backend holds token inventory and receives engine-certified transfers through per-user mailboxes. Base providers supply storage, Nostr transport, and oracle configuration; payment functionality requires a second configuration layer added with createWalletApiProviders. The SDK supports HD addresses, replaceable payment transport ports, browser or file-backed persistence, and wallet-to-dApp communication, making it suitable for teams embedding economic identity and settlement in agents, services, dApps, or wallet interfaces.
An application starts with createBrowserProviders or createNodeProviders to construct storage, Nostr transport, and oracle configuration, then attaches the required wallet-api configuration with createWalletApiProviders before calling Sphere.init. The SDK derives identities and multiple addresses with BIP39/BIP32, registers or recovers nametags, and exposes a primary DIRECT:// address. sphere.payments lists assets and history, drains incoming mailbox transfers, self-mints testnet tokens, and executes send() through durable transfer intents; completed v2 CBOR token blobs are proof- and ownership-checked before entering the balance. sphere.payments.requests creates, pays, declines, and tracks requests with encrypted memos, while sphere.market exposes a signed intent bulletin board with semantic search and a live feed. sphere.communications sends and receives NIP-17 encrypted direct messages, and the optional sphere.groupChat module uses a separate NIP-29 relay for groups, invitations, messages, and moderation. Additional interfaces cover the Connect protocol, dynamic relay management, encrypted wallet export/import, optional CoinGecko prices, and crypto, currency, hashing, and Base58 utilities.
- A browser-wallet or dApp team can combine localStorage or IndexedDB with
ConnectClient/ConnectHostand the Sphere extension or popup flow. - A developer building autonomous trading agents can give each agent a locally held identity, resolve recipients through nametags or
DIRECT://addresses, and settle withsphere.payments.send(). - A Node.js service or batch application can use file-backed storage and a stable
deviceId, explicitly callreceive()to drain its mailbox, and resume unfinished transfers after restart. - An application collecting payments can create requests through
sphere.payments.requests, include encrypted memos, and react topending,settling,paid,rejected, andexpiredstates. - A product requiring agent-to-agent communication can use NIP-17 private messages or enable NIP-29 groups with private invitations, unread counts, and administrator or moderator controls.
- A team testing Unicity v2 asset flows can self-mint on testnet/testnet2 and exercise multi-address wallets, transfer recovery, and mailbox delivery.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npm install @unicitylabs/sphere-sdknpm install -g @unicity-sphere/cli
How do you install or deploy this agent?
Install the SDK package:
npm install @unicitylabs/sphere-sdkThe documented Node.js setup also requires ws, although the source does not provide its exact installation command. The CLI is maintained as a separate package and can be installed when needed:
npm install -g @unicity-sphere/cli
sphere --helpOperational payments additionally require access to a v2 gateway, a wallet-api deployment, and the appropriate oracle API key. The published testnet2 key may be used in client-side test code; a mainnet key must remain secret in the deployment environment.
How do you use this agent?
Browser initialization has two required provider layers. This example creates the base providers, attaches wallet-api, initializes a wallet, and submits a transfer:
import { Sphere } from '@unicitylabs/sphere-sdk';
import { createBrowserProviders } from '@unicitylabs/sphere-sdk/impl/browser';
import { createWalletApiProviders } from '@unicitylabs/sphere-sdk/impl/shared/wallet-api';
const base = createBrowserProviders({
network: 'testnet',
oracle: { apiKey: 'sk_ddc3cfcc001e4a28ac3fad7407f99590' },
});
const providers = createWalletApiProviders(base, {
baseUrl: 'https://wallet-api.unicity.network',
network: 'testnet2',
deviceId: 'my-stable-device-id',
});
const { sphere, created, generatedMnemonic } = await Sphere.init({
...providers,
autoGenerate: true,
});
if (created && generatedMnemonic) {
console.log('SAVE THIS RECOVERY PHRASE:', generatedMnemonic);
}
const result = await sphere.payments.send({
recipient: '@alice',
amount: '1000000',
coinId: 'UCT',
memo: 'hello',
});
console.log(result.status);
const { transfers } = await sphere.payments.receive();
console.log(transfers);
console.log(await sphere.payments.assets());Amounts must be decimal strings rather than JavaScript numbers. The recipient must have a published identity containing a chain public key, or the call fails with INVALID_RECIPIENT. A result with status === 'completed' and deliveryPending === true is already certified on-chain; only mailbox delivery is deferred, so the UI must not report it as a payment failure. If send() throws CERTIFICATION_UNCONFIRMED, do not issue a fresh send() because the original intent may already be certified; the SDK resumes it automatically under the same transferId, while a new call could double-pay the recipient. For wallets holding real value, pass a user password to Sphere.init, Sphere.create, or Sphere.load instead of relying on the built-in default-key obfuscation.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- data-flow disclosure
What are this agent's strengths and limitations?
- Durable server-side transfer intents resume under the same
transferId, covering crashes and partially committed outcomes without intentionally creating a second spend. - Keys stay on the client while wallet-api handles inventory and mailbox delivery, and every incoming token is proof- and ownership-verified before it affects the balance.
- One SDK combines payments, requests, signed market intents, NIP-17 direct messages, NIP-29 groups, multi-address wallets, and the Connect protocol.
- Documented provider implementations cover browsers and Node.js, while the money-port contracts and
paymentsV2Transportseam support custom hosts and offline test replacements. - The package includes practical supporting features such as strict amount parsing, encrypted import/export, dynamic relay management, and optional CoinGecko price data.
- Payments are not a purely client-side or self-custodied inventory design: the wallet-api backend holds token inventory, sessions, and recipient mailboxes.
- Initialization requires both the base-provider layer and wallet-api layer, with network configuration in both places; omissions cause
INVALID_CONFIG. - Mainnet and dev still target v1-era aggregators, so
sendandmintfail withAGGREGATOR_ERRORuntil those gateways move to v2. CERTIFICATION_UNCONFIRMEDrequires specialized application handling and must never trigger a fresh send, or automatic recovery of the original intent may lead to a double payment.- There is no bundled default gateway API key; Node.js also requires
ws, and operation depends on gateway, wallet-api, and Nostr relay availability. - Without a user-supplied password, the seed receives only built-in-key obfuscation at rest, which is unsuitable for a wallet holding real value.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Sphere SDK This agent | 71 · Some gaps | Library / SDKFree | ★ 5.4k | 20d ago | TypeScript | — |
| Deuz SDK | 76 · Good | Library / SDKFree + model costs | ★ 504 | 8d ago | TypeScript | OpenAI API · Claude API |
| Excalibur (xcb) | 71 · Some gaps | — | ★ 14 | 1mo ago | Rust | Claude Code |
| TrueForge | 65 · Some gaps | CLIFree + model costs | ★ 6.7k | today | TypeScript | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
The README distinguishes local keys, server-custodied token inventory, the wallet-api mailbox, and Nostr messaging, and makes a messaging-only wallet an explicit walletApi: 'none' choice. It also tells users to back up the mnemonic, keep a mainnet API key in the deployment environment, and avoid resending payments that may have committed. These support data-flow transparency and ordinary-use permission boundaries. Deductions: the source sample does not show the key-encryption implementation, key lifecycle, or authorization details; payments create on-chain and mailbox effects, but no cancellation or rollback mechanism is shown; attribution is limited to author and repository fields in package.json, while publisher identity remains unknown.
The documentation carefully distinguishes confirmed-but-pending delivery, possibly committed outcomes, and clean failures, and explains recovery and error handling. The CI file specifies type checks, builds, tests, and mutation testing on Node 22 and 24. Entry-point and package-export information also partly corroborates module boundaries. Deductions: this is static evidence, so the CI configuration does not establish that this revision passed; the README is incomplete in the packet, so full consistency and runtime behavior cannot be confirmed.
The material covers browser and Node.js use, CLI guidance, dApp Connect, messaging-only wallets, and payment wallets, and describes network, device-ID, and composition constraints. Deductions: these are primarily SDK integration scenarios; the supplied material does not explain Agent-specific negotiation or delegated-permission configuration in detail. Trigger conditions and environment coverage are useful but incomplete.
The README and quick starts provide install commands, browser and Node.js examples, a TypeScript declaration shim, migration guidance, and extensive known limitations; the MIT license text is clear. The package version, export subpaths, and publishing workflow are also documented. Deductions: no CHANGELOG is included in the packet, so the detailed migration notes do not establish a complete change history; CLAUDE.md mainly gives contributor and project workflow guidance, and maintenance ownership or support contacts are not clear.
Examples provide practical initialization, payment, receiving, and error-handling code, including guidance not to send a possibly committed payment again. Deductions: the documentation is long and repeats network and payment-state explanations, increasing integration effort; the supplied material does not quantify Agent automation benefits or operating costs.
Key integration claims can be traced across the README, quick starts, package.json, entry-point exports, and CI configuration. The aggregator test file explains what testing against a real service is meant to verify beyond a fake. Deductions: static test code and workflow configuration are not execution results for this revision; several network, recovery, and security claims remain primarily documentary because the supplied source sample cannot independently verify them.
- The documentation identifies the mainnet API key as a secret; do not put it in browser bundles or public examples. Mnemonics also need a reliable backup flow, including when initialization fails or a later launch loads an existing wallet.
- A payment may already be committed on-chain while delivery is pending. Do not call send again; use pendingTransfers() and resumeNow() as documented.
- Node.js requires version 22 or later and an additional ws install. The browser entry lacks type declarations, so strict TypeScript projects need to supply a shim.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
v0.8.0 v0.8.0 — UXF Inter-Wallet Transfer Protocol + Profile-layer hardening
Release notes excerpt
178 PRs promoted from integration/all-fixes to main. - Release PR: [#345](https://github.com/unicity-sphere/sphere-sdk/pull/345) - Tag points at: af41bea6fc36 - Period covered: ~4 months of accumulated profile-layer, UXF, recovery, and connectivity work since the previous release lineage (PRs #128–#130 → #303–#342). ⚠️ Breaking: UXF wire-shape default flip …View on GitHub ↗ -
Release notes excerpt
Bug Fixes - CLI process exit: Fix CLI commands hanging ~10s after completion due to lingering Nostr WebSocket handles - Instant split change token: Fix sender losing change token when process.exit() killed background proof collection before completion Changes - InstantSplitExecutor.submitBackgroundV5 now returns a trackable Promise<void> instead of fire-and-forget - PaymentsModule tracks background promises and exposes waitForPendingOperations() for callers to await completion - CLI send command awaits pending background operations before exiting …View on GitHub ↗
FAQ
Where are keys and tokens stored?
Does deliveryPending mean that payment failed?
status === 'completed', the spend succeeded. deliveryPending === true means certification is complete but delivery to the recipient's wallet-api mailbox was deferred and will be retried.Can an application retry after CERTIFICATION_UNCONFIRMED?
send(). The transfer may already be certified, and the SDK retains and resumes the original intent with the same transferId; sending again can pay the recipient twice.Which documented networks currently support sending and self-minting?
testnet aliases the testnet2 v2 gateway at networkId 4. The documentation states that mainnet and dev still use v1-era aggregators, so their send and mint operations currently fail.Does Nostr carry the payment itself?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.