@hashgraphonline/standards-sdk

中文文档
0.1.192发布于 2026/10/19Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 6179

The Hashgraph Online Standards SDK provides a complete implementation of the Hiero Consensus Standards (HCS), giving developers all the tools needed to build wonderful decentralized applications on the Hashgraph network. https://hol.org

原始使用文档
文档目录16 节
  1. Quick Start
  2. Optional dependencies for @hol-org/rb-client
  3. Documentation
  4. Registry Broker skill verification (DNS TXT domain proof)
  5. Registry Broker skill lifecycle status
  6. Registry Broker UAID DNS verification (HCS-14 DNS TXT profi…
  7. Interactive CLI and Demos
  8. Supported Standards
  9. Running Demos
  10. Demo Descriptions
  11. Contributing
  12. Security
  13. Maintainers
  14. Resources
  15. 📝 Blog Tutorials
  16. License

HOL Standards SDK

A lightweight SDK providing reference implementations for Hashgraph Consensus Standards (HCS) created by HOL.

This SDK is built and maintained by HOL, a consortium of leading Hedera Organizations within the Hedera ecosystem.

📚 Standards SDK Documentation
📖 HCS Standards Documentation

Quick Start

npm install @hol-org/standards-sdk
# Legacy scope:
# npm install @hashgraphonline/standards-sdk

For the standalone Registry Broker client with a smaller footprint:

npm install @hol-org/rb-client

HOL-scoped distributions are published in parallel:

  • @hol-org/rb-client: registry broker client only
  • @hol-org/standards-sdk: full SDK under the HOL scope

Optional dependencies for @hol-org/rb-client

The client ships with zero network transports bundled. Install these peers when you need the related features:

  • axios + x402-axios + x402 for X402 credit purchases and payments
  • viem for EVM-based ledger authentication
  • @hashgraph/sdk for Hedera ledger authentication

Core agent search/chat flows only require a fetch implementation.

Documentation

For complete documentation, examples, and API references, visit:

Registry Broker skill verification (DNS TXT domain proof)

The RegistryBrokerClient supports version-scoped skill verification plus DNS TXT domain proof:

import { RegistryBrokerClient } from '@hashgraphonline/standards-sdk';

const client = new RegistryBrokerClient({
  apiKey: process.env.REGISTRY_BROKER_API_KEY,
});

await client.requestSkillVerification({
  name: 'demo-skill',
  version: '1.0.0',
  tier: 'basic', // or 'express'
});

const challenge = await client.createSkillDomainProofChallenge({
  name: 'demo-skill',
  version: '1.0.0',
  domain: 'example.com',
});

const challengeToken = challenge.txtRecordValue.replace(/^hol-skill-verification=/, '');

await client.verifySkillDomainProof({
  name: 'demo-skill',
  version: '1.0.0',
  domain: 'example.com',
  challengeToken,
});

Runnable demo: pnpm -C standards-sdk tsx demo/registry-broker/skill-domain-proof-demo.ts --skill-name=<name> --base-url=<broker-api-url>.

Registry Broker skill lifecycle status

The RegistryBrokerClient can resolve lifecycle status for a skill name/version and surface preview evidence when a repo has only completed validate-first checks:

import { RegistryBrokerClient } from '@hashgraphonline/standards-sdk';

const client = new RegistryBrokerClient({
  baseUrl: 'https://hol.org/registry/api/v1',
});

const status = await client.getSkillStatus({
  name: 'registry-broker',
  version: '1.0.0',
});

console.log(status.trustTier);
console.log(status.nextSteps);
console.log(status.preview?.statusUrl ?? null);

Runnable demo: pnpm -C standards-sdk run demo:registry-broker-skill-status -- --skill-name=<name> --skill-version=<version> --base-url=<broker-api-url>.

Registry Broker UAID DNS verification (HCS-14 DNS TXT profile)

The RegistryBrokerClient can verify and persist _uaid.<nativeId> TXT proof for an agent UAID:

import { RegistryBrokerClient } from '@hashgraphonline/standards-sdk';

const client = new RegistryBrokerClient({
  baseUrl: 'https://hol.org/registry/api/v1',
});

const verify = await client.verifyUaidDnsTxt({
  uaid: 'uaid:aid:...;uid=...;proto=a2a;nativeId=agent.hol.org',
  persist: true,
});

const status = await client.getVerificationDnsStatus(
  'uaid:aid:...;uid=...;proto=a2a;nativeId=agent.hol.org',
  { refresh: true, persist: false },
);

Runnable demo: pnpm -C standards-sdk run demo:registry-broker-uaid-dns -- --uaid=<uaid> --base-url=<broker-api-url>.

Interactive CLI and Demos

Launch the bundled CLI to explore registry broker demos, inspect required env vars, and run helper scripts:

pnpm run cli

The CLI surfaces:

  • Guided registry broker demos (OpenRouter, chat history, ledger auth) plus the HCS-10 agent flows.
  • A map of required env vars so you can bootstrap Hedera credentials and adapters quickly.
  • Links back to the docs plus the demo scripts you can run manually (demo/registry-broker, demo/hcs-10).

See cli/standards-cli/README.md for advanced and non-interactive commands.

Supported Standards

StandardDescription
HCS-1File Storage
HCS-2Registry and Indexing Standard
HCS-3Recursive File Loading
HCS-7Smart Hashinals
HCS-10Trustless Peer-to-Peer Communication for Agents and AI
HCS-11Decentralized Profile and Identity Standard
HCS-20Auditable Points
HCS-27Transparency Logs

Running Demos

The SDK includes demo implementations that showcase registry broker flows (discovery, chat, ledger auth, OpenRouter) and HCS-10 agent communication. Follow these steps to run them:

  1. Clone the repository

    git clone https://github.com/hashgraph-online/standards-sdk.git
    cd standards-sdk
    
  2. Install dependencies

    npm install
    
  3. Set up environment variables

    cp .env.example .env
    
  4. Edit the .env file with your Hedera credentials:

    HEDERA_ACCOUNT_ID=0.0.12345
    HEDERA_PRIVATE_KEY=your_private_key_here
    HEDERA_NETWORK=testnet
    REGISTRY_URL=https://moonscape.tech
    

    The CLI can also auto-persist agent state in .env if a demo is interrupted. See .env.example for generated state fields.

  5. Start a demo (or use pnpm run cli for an interactive launcher):

    npm run demo:registry-broker
    
    npm run demo:hcs-10
    

Each demo directory contains README instructions plus you can review demo/registry-broker and demo/hcs-10 for fine-grained scripts covering OpenRouter, history snapshots, ledger authentication, and fee flows.

Demo Descriptions

Inscribe Demo

The inscribe demo (demo/inscribe-demo.ts) showcases different file inscription capabilities:

  • Text inscription using buffers
  • URL-based inscriptions
  • File buffer inscriptions
  • Creating Hashinal NFTs from URLs
  • Creating Hashinal NFTs from buffers
  • Creating Hashinal NFTs from text content

Each inscription demonstrates different options and metadata capabilities.

HCS-10 AI Agent Communication Demo

The HCS-10 demo (demo/hcs-10/index.ts) demonstrates trustless peer-to-peer communication between AI agents:

  • Agent creation and registration (Alice and Bob)
  • Agent metadata and profile management
  • Connection establishment between agents
  • Sending and retrieving small messages
  • Sending and retrieving large messages with recursive storage
  • Message data processing
  • Resumable agent creation: If agent creation is interrupted, the SDK automatically resumes from where it left off using state saved in environment variables

The demo automatically handles agent funding, topic creation, and registration with the global registry. Agent creation progress is tracked in real-time and saved to the .env file, allowing recovery from any interruption.

Contributing

Please read our Contributing Guide and Code of Conduct before contributing to this project.

For bugs and feature requests, please use the issue templates.

Security

For security concerns, please refer to our Security Policy.

Maintainers

See MAINTAINERS.md for a list of project maintainers.

Resources

📝 Blog Tutorials

License

Apache-2.0

版本与发布记录

@hashgraphonline/standards-sdk 共发布 579 个版本,首次发布于 2025/03/14;过去 12 个月发布了 325 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.192latest2026/10/1929 天前
0.1.1912026/10/081 个月前
0.1.1902026/10/061 个月前
0.1.1892026/10/021 个月前
0.1.158-feat-agent-network-subscriptions.canary.b2176d5.1492026/10/021 个月前
0.1.1882026/10/011 个月前

其他发布通道:canary-feat-setup-canary-pipeline-for-npm-releases → 0.1.116-feat-setup-canary-pipeline-for-npm-releases.canary.135f7d1.3,canary-fix-hiero-did-import → 0.1.117-fix-hiero-did-import.canary.a27d005.4,canary-fix-browser-imports → 0.1.118-fix-browser-imports.canary.b290965.5,canary-feat-registry-broker-demos → 0.1.125-feat-registry-broker-demos.canary.c17bfd4.13.2,canary-feat-interactive-cli → 0.1.125-feat-interactive-cli.canary.d7618f0.17,canary-feat-async-registrations → 0.1.126-feat-async-registrations.canary.27a51b1.18.2。

关于 @hashgraphonline/standards-sdk 的常见问题

@hashgraphonline/standards-sdk 是什么?

The Hashgraph Online Standards SDK provides a complete implementation of the Hiero Consensus Standards (HCS), giving developers all the tools needed to build wonderful decentralized applications on the Hashgraph network. https://hol.org

如何安装 @hashgraphonline/standards-sdk?

在项目目录运行 npm install @hashgraphonline/standards-sdk,或使用 pnpm add / yarn add / bun add。

@hashgraphonline/standards-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@hashgraphonline/standards-sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@hashgraphonline/standards-sdk 可以商用吗?

@hashgraphonline/standards-sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@hashgraphonline/standards-sdk 的下载量有多少?

根据 npm 官方下载统计,@hashgraphonline/standards-sdk 在 2026/10/18 – 2026/11/16 这 30 天内被下载 6,179 次,日均约 206 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@hashgraphonline/standards-sdk 还在维护吗?

最新版本 0.1.192 发布于 2026/10/19(29 天前);至今共发布 579 个版本,其中过去 12 个月发布了 325 个;首次发布于 2025/03/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。