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 提供一套模块化的 TypeScript 工具包,用于管理钱包并在 Unicity Layer 3 状态转移网络上执行操作。它简化了处理 BIP39/BIP32 密钥派生、安全代币转移以及 Unicity 生态系统内去中心化通信的复杂性。

How it works

SDK 使用分层提供者模型,将核心钱包状态与网络传输服务分离:

  1. Base Layer: 处理存储、传输(通过 Nostr 进行消息),以及 oracle(网关/信任基础)。
  2. Wallet-API Layer: 为通过 mailbox 系统和服务器端代币存储的交付添加“轨道”。

支付由代币引擎在链上认证,并通过专用的 wallet‑api mailbox 交付,而不是消息层。它支持 HD(层级确定性)钱包,允许用户从单一种子派生多个地址。

Who it’s for

  • Developers 构建需要集成 Unicity L3 网络的 dApp。
  • Wallet Integrators 创建浏览器扩展或 Node.js 应用进行代币管理。
  • Bot Developers 在 Unicity 网络上创建自动支付或消息代理。

Highlights

  • Engine-Certified Payments: 具自我修复的币选择过程和并发发送安全的安全代币转移。
  • Multi-Address Support: 完整的 BIP32/BIP44 HD 地址派生和每个地址的名称标签注册。
  • Decentralized Communication: 集成基于 Nostr 的 DM 与 NIP-29 中继的群组消息,具审核功能。
  • Atomic Swaps: 通过托管和基于 DM 的协商进行 P2P 代币交换。
  • Flexible Custody: 支持服务器端托管(通过 wallet‑api)和自托管(外部存储)。
  • Connect Protocol: 内置 dApp 与钱包浏览器扩展之间的通信桥接。