unicity-sphere/sphere-sdk

The SDK for autonomous economic agents. Give an agent an identity, a wallet, and the ability to find, negotiate with, and settle with other agents - peer-to-peer, with perfect privacy and ultra-fast finality

What it solves

Sphere SDK provides a modular TypeScript toolkit for interacting with the Unicity state transition network. It simplifies the complex process of managing digital wallets, executing certified token transfers, and handling decentralized messaging, allowing developers to integrate payment and identity features into browser or Node.js applications without building the underlying infrastructure from scratch.

How it works

The SDK uses a layered provider model to separate core wallet functions from the payment transport layer. It combines a base layer (handling storage, identity, and Nostr-based messaging) with a specific wallet-api transport layer that manages the actual movement of funds. While keys remain local to the client for security, token inventory is managed server-side. The system ensures payment safety through "engine-certified" transfers and a durable intent system that prevents double-spending even during network crashes or inconclusive proofs.

Who it’s for

It is designed for TypeScript developers building decentralized applications (dApps), digital wallets, or payment-integrated platforms that require secure, crash-safe token transfers and decentralized identity management.

Highlights

  • Crash-Safe Payments: Uses durable server-side intents and a mailbox delivery system to ensure transfers are completed without double-paying.
  • Hybrid Custody: Keeps private keys local to the user while leveraging server-side inventory management for efficiency.
  • Multi-Address Support: Implements BIP32/BIP44 HD wallet derivation for managing multiple addresses from a single seed.
  • Decentralized Messaging: Integrates Nostr (NIP-17 and NIP-29) for direct messages, group chats, and nametag publishing.
  • Modular Architecture: Swappable provider layers allow the SDK to work across different environments (Browser, Node.js) and custom network configurations.

Related

  • Project
  • Project
  • Project
  • Project
  • Project