npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

satoshi-payment-interface

v0.1.0

Published

Satoshi Payment Interface (SPI) V1 bilingual Go/TypeScript SDK with deterministic CBOR, HTTP authentication, and CollectOnce

Readme

Satoshi Payment Interface

SPI(Satoshi Payment Interface)V1 双语 Go/TypeScript SDK。npm 包名使用 npm 兼容的 satoshi-payment-interface,完整产品名仍为 Satoshi Payment Interface。它把余额查询/回收协议固定为严格的 deterministic CBOR;本包同时提供 HTTP AuthenticatedEnvelope 和 libp2p /spi/1.0.0 Stream 适配器。bitcoin-libp2p 只提供通用身份、Noise、Yamux 和 transport。 SPI payload 本身不携带公钥、签名、session_id 或过期时间。

Satoshi Payment Interface (SPI) V1 is a bilingual Go/TypeScript SDK. The TypeScript package is published as satoshi-payment-interface; the matching Go module is github.com/bsv8/SPI. Both SDKs use the same deterministic CBOR wire format, HTTP authentication envelope, and libp2p /spi/1.0.0 adapter.

安装 / Install:

npm install [email protected]

金额字段只能使用 TypeScript bigint;Go 侧对应 uint64。生产服务必须把 CollectOnce 的去重、全量校验、统一扣款和结果保存放进一次数据库事务。

import { newInformationRequest, parseResponse } from 'satoshi-payment-interface'

const request = newInformationRequest()
// 传输 request.wire 后,用传输层 pin 的服务公钥验证 HTTP 外壳,再解析响应:
// const response = parseResponse(payload, request.requestId)

libp2p 使用由 bitcoin-libp2p 创建的 Noise 已认证 connection:

const server = await registerServer(node, backend)
const responseWire = await createClient().call(connection, request.wire)

服务端从 authenticated connection 取得 remote_public_key,调用统一 handleRequest; 客户端每个 Stream 只发送一个请求并读取一个响应。

CDDL 说明协议结构;长度、数量和分配前安全边界由 Go/TypeScript SDK 常量及单元测试 执行。CDDL 不替代运行时输入校验。

HTTP 外壳只做签名认证和完整性保护,不提供内容保密;公网请使用 HTTPS。LocalSigner 仅用于测试和可信单进程示例,不要把测试私钥模式带入生产浏览器。