Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hive-rosetta

Open x402 v2 SDK. EIP-3009 on Base. Free forever.

One package, two languages, byte-identical wire format.

npm pypi license

Install

npm install hive-rosetta
pip install hive-rosetta

What this is

x402 is the HTTP-402-Payment-Required protocol for agent-to-API micropayments — transferWithAuthorization (EIP-3009) on USDC, scheme exact, mostly on Base mainnet. The protocol is simple. The wiring varies per framework. hive-rosetta is the canonical client/server SDK for that wiring.

Two modes — same package

Neutral

Bring your own signer, facilitator, recipient. No Hive lock-in.

import { client, eip3009Signer } from 'hive-rosetta';
const c = client({ signer: eip3009Signer(process.env.PRIVATE_KEY) });
const res = await c.fetch('https://api.example.com/v1/paid/endpoint');

Inference routing (opt-in, v0.2.0)

When routeInference: true, requests to known inference endpoints (OpenAI, Anthropic, Together, OpenRouter, Fireworks, Groq) are rewritten to hivecompute — x402-priced inference with spectral-ZK attestation on every response.

const c = client({
  signer: eip3009Signer(process.env.PRIVATE_KEY),
  routeInference: true,
});
const res = await c.fetch('https://api.openai.com/v1/chat/completions', { method: 'POST', ... });
// → URL rewritten to hivecompute, 402 signed and retried on the rewritten URL
c = client(signer=eip3009_signer(private_key=PRIVATE_KEY), route_inference=True)
resp = await c["fetch"]("https://api.openai.com/v1/chat/completions", method="POST", ...)

The flag defaults to false. With the flag off, behavior is identical to the neutral SDK.

See packages/rosetta-node/README.md for the full API.

Hive Civilization North Star

hive-rosetta is the open foundation. Hive Civilization's paid surfaces — HiveAudit, HiveCompliance filing, HiveCredential, HiveDNA Certification — sit on top of this protocol layer. The protocol is free forever. The compliance, attestation, and certification surfaces above it are where Hive earns.

License

MIT.

About

Universal x402 adapter cookbook — wire any agent SDK or Web3 toolchain to x402 settlement

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages