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 managing wallets and performing operations on the Unicity Layer 3 state transition network. It simplifies the complexity of handling BIP39/BIP32 key derivation, secure token transfers, and decentralized communication within the Unicity ecosystem.
How it works
The SDK uses a layered provider model to separate core wallet state from network delivery services:
- Base Layer: Handles storage, transport (via Nostr for messaging), and the oracle (gateway/trust base).
- Wallet-API Layer: Adds the "rails" for delivery via a mailbox system and server-side token storage.
Payments are certified on-chain by a token engine and delivered through a dedicated wallet-api mailbox rather than the messaging layer. It supports HD (Hierarchical Deterministic) wallets, allowing users to derive multiple addresses from a single seed.
Who it’s for
- Developers building dApps that need to integrate with the Unicity L3 network.
- Wallet Integrators creating browser extensions or Node.js applications for token management.
- Bot Developers creating automated payment or messaging agents on the Unicity network.
Highlights
- Engine-Certified Payments: Secure token transfers with a self-healing coin selection process and concurrent-send safety.
- Multi-Address Support: Full BIP32/BIP44 HD address derivation and nametag registration per address.
- Decentralized Communication: Integrated Nostr-based DMs and NIP-29 relay-based group messaging with moderation.
- Atomic Swaps: P2P token swaps via escrow and DM-based negotiation.
- Flexible Custody: Supports both server-side custody (via wallet-api) and own-custody (external storage).
- Connect Protocol: Built-in communication bridge between dApps and wallet browser extensions.