Tenzro Testnet is live. Get testnet TNZO

API Reference

Tenzro provides two primary APIs: JSON-RPC for blockchain operations and Web Verification API for cryptographic verification.

JSON-RPC API

The JSON-RPC server runs on 127.0.0.1:8545 by default and provides Ethereum-compatible methods plus Tenzro-specific extensions.

Ethereum-Compatible Methods

eth_blockNumber

Returns the current block number.

Request:
{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": "0x4b7", "id": 1 }

eth_getBalance

Returns the balance of an account at a given block.

Parameters:
  • address — Address to check balance
  • block — Block number or "latest"
Request:
{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5", "latest"], "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": "0x0234c8a3397aab58", "id": 1 }

eth_sendRawTransaction

Submits a signed transaction to the network.

Parameters:
  • data — Signed transaction data (hex)
Request:
{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf86c..."], "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": "0x1234567890abcdef...", "id": 1 }

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

Request:
{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x1234567890abcdef..."], "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": { "transactionHash": "0x1234567890abcdef...", "blockNumber": "0x4b7", "gasUsed": "0x5208", "status": "0x1" }, "id": 1 }

net_peerCount

Returns the number of connected peers.

Request:
{ "jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": "0x19", "id": 1 }

Tenzro-Specific Methods

tenzro_nodeInfo

Returns information about the node.

Response:
{ "jsonrpc": "2.0", "result": { "version": "0.1.0", "role": "validator", "peer_id": "12D3KooWABC...", "chain_id": 1337, "block_height": 1207 }, "id": 1 }

tenzro_createAccount

Creates a new MPC threshold wallet.

Parameters:
  • threshold — Threshold (e.g., 2 for 2-of-3)
  • total_shares — Total shares (e.g., 3)
Response:
{ "jsonrpc": "2.0", "result": { "address": "tenzro1abc...xyz", "threshold": 2, "total_shares": 3 }, "id": 1 }

tenzro_listModels

Lists available AI models on the network.

Parameters (optional):
  • category — Filter by category (e.g., "llm", "vision")
  • modality — Filter by modality (e.g., "text", "image")
Response:
{ "jsonrpc": "2.0", "result": [ { "id": "llama-3-70b", "name": "Llama 3 70B", "category": "llm", "modality": "text", "price_per_token": "0.0001" } ], "id": 1 }

tenzro_registerIdentity

Registers a new TDIP identity (human or machine).

Parameters:
  • identity_type — "human" or "machine"
  • display_name — Display name (for humans)
  • controller_did — Controller DID (for non-autonomous machines)
Response:
{ "jsonrpc": "2.0", "result": { "did": "did:tenzro:human:550e8400-e29b-41d4-a716-446655440000", "wallet_address": "tenzro1def...uvw" }, "id": 1 }

tenzro_requestInference

Requests AI inference from a model.

Parameters:
  • model_id — Model identifier
  • input — Input data (format depends on model)
  • max_tokens — Maximum tokens to generate (optional)
Response:
{ "jsonrpc": "2.0", "result": { "request_id": "req_abc123", "status": "pending", "estimated_cost": "0.05 TNZO" }, "id": 1 }

Onboarding Methods

tenzro_participate

One-click onboarding: provisions a TDIP identity, MPC wallet, and hardware profile on the Tenzro Ledger. This is the primary method for new users joining the network.

Parameters:
  • display_name — Display name for the identity
Request:
{ "jsonrpc": "2.0", "method": "tenzro_participate", "params": [{ "display_name": "Alice" }], "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": { "identity": { "did": "did:tenzro:human:550e8400-e29b-41d4-a716-446655440000", "display_name": "Alice", "identity_type": "human", "status": "active" }, "wallet": { "wallet_id": "w-a1b2c3d4", "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5", "threshold": "2-of-3", "key_type": "Ed25519" }, "hardware": { "cpu_model": "Apple M2 Pro", "cpu_cores": 12, "cpu_threads": 12, "total_ram_gb": 32.0, "gpus": [] } }, "id": 1 }

tenzro_importIdentity

Imports an existing private key to create a TDIP identity and MPC wallet. The key is used to derive the wallet address, and MPC shares are generated and stored in an encrypted keystore.

Parameters:
  • private_key — Hex-encoded private key (with or without 0x prefix)
  • key_type — Key algorithm: "ed25519" or "secp256k1"
  • display_name — Display name for the identity
  • password — Password for encrypting wallet key shares (securely encrypted)
Request:
{ "jsonrpc": "2.0", "method": "tenzro_importIdentity", "params": [{ "private_key": "0x4c0883a69102937d...", "key_type": "ed25519", "display_name": "Alice", "password": "secure-password" }], "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": { "identity": { "did": "did:tenzro:human:661f9500-f30c-52e5-b827-557766551111", "display_name": "Alice", "identity_type": "human", "status": "active" }, "wallet": { "wallet_id": "w-e5f6g7h8", "address": "0x8Ba1f109551bD432803012645Ac136ddd64DBA72", "threshold": "2-of-3", "key_type": "Ed25519" }, "hardware": { "cpu_model": "Apple M2 Pro", "cpu_cores": 12, "total_ram_gb": 32.0 } }, "id": 1 }

Identity Methods

tenzro_resolveIdentity

Resolves a DID to its identity record.

Parameters:
  • did — The DID to resolve (e.g., "did:tenzro:human:...")
Response:
{ "jsonrpc": "2.0", "result": { "did": "did:tenzro:human:550e8400-...", "display_name": "Alice", "identity_type": "human", "kyc_tier": "Unverified", "status": "active", "wallet_address": "0x742d35Cc..." }, "id": 1 }

tenzro_resolveDidDocument

Returns a W3C-compliant DID Document for a given DID.

Parameters:
  • did — The DID to resolve
Response:
{ "jsonrpc": "2.0", "result": { "@context": "https://www.w3.org/ns/did/v1", "id": "did:tenzro:human:550e8400-...", "verificationMethod": [...], "authentication": [...] }, "id": 1 }

Provider Methods

tenzro_getHardwareProfile

Detects and returns the hardware profile of the current machine (CPU, RAM, GPUs, TEE capabilities).

Response:
{ "jsonrpc": "2.0", "result": { "cpu_model": "AMD EPYC 7763", "cpu_cores": 64, "cpu_threads": 128, "total_ram_gb": 256.0, "gpus": [ { "name": "NVIDIA A100", "memory_gb": 80.0 } ], "tee_support": "AmdSevSnp" }, "id": 1 }

tenzro_setRole

Sets the node role (validator, provider, tee-provider, user).

Parameters:
  • role — Node role: "validator", "provider", "tee-provider", or "user"
Response:
{ "jsonrpc": "2.0", "result": { "role": "provider", "status": "active" }, "id": 1 }

tenzro_serveModel

Starts serving a model for inference requests on the network.

Parameters:
  • model_id — Model to serve
  • price_per_token — Price per token in TNZO (optional)
Response:
{ "jsonrpc": "2.0", "result": { "model_id": "llama-3-70b", "status": "serving", "price_per_token": "0.0001" }, "id": 1 }

Payment Methods

tenzro_createPaymentChallenge

Creates an HTTP 402 payment challenge for a resource. Supports MPP (Machine Payments Protocol) and x402 protocols.

Parameters:
  • resource — Resource URL or identifier
  • amount — Amount in TNZO
  • protocol — Payment protocol: "mpp" or "x402"
Response:
{ "jsonrpc": "2.0", "result": { "challenge_id": "ch_abc123", "protocol": "mpp", "amount": "0.05", "expires_at": "2025-01-15T12:00:00Z" }, "id": 1 }

tenzro_payMpp

Pays for a resource using the MPP (Machine Payments Protocol, co-authored by Stripe and Tempo).

Parameters:
  • challenge_id — Challenge ID from tenzro_createPaymentChallenge
  • wallet_address — Payer wallet address
Response:
{ "jsonrpc": "2.0", "result": { "receipt_id": "rcpt_def456", "status": "paid", "transaction_hash": "0xabc123..." }, "id": 1 }

Web Verification API

The Web Verification API runs on 0.0.0.0:8080 by default and provides HTTP endpoints for cryptographic verification.

Endpoints

POST /api/verify/zk-proof

Verifies a zero-knowledge proof. Supports Groth16, Plonk, and Stark proof types with structural validation (minimum proof size, public input requirements).

Request Body:
{ "proof_type": "groth16", "proof_bytes": "0xabc123...", "public_inputs": ["0x123", "0x456"], "verification_key": "0xdef789..." }
Response:
{ "valid": true, "details": { "proof_type": "groth16", "public_inputs_count": 2, "proof_size_bytes": 128, "verification_key_provided": true, "status": "verified" }, "verified_at": "2026-03-22T12:00:00Z" }
Proof types: groth16 (≥128 bytes + public inputs), plonk (≥256 bytes), stark (≥32 bytes)

POST /api/verify/tee-attestation

Verifies a TEE attestation report using the AttestationVerifier from tenzro-tee. Supports Intel TDX, AMD SEV-SNP, AWS Nitro, and NVIDIA GPU TEE vendors.

Request Body:
{ "attestation_data": "0xdef456...", "vendor": "intel_tdx", "report_data": "0xabcdef..." }
Response:
{ "valid": true, "details": { "vendor": "intel_tdx", "attestation_size": 64, "report_data_size": 32 }, "verified_at": "2026-03-22T12:00:00Z" }
Vendors: intel_tdx, amd_sev_snp, aws_nitro, nvidia_gpu, intel_sgx

POST /api/verify/transaction

Verifies a transaction signature using Ed25519 cryptographic verification.

Request Body:
{ "tx_hash": "0x789abc...", "sender": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5", "signature": "0xdef123...", "public_key": "0x0123456789abcdef..." }
Response:
{ "valid": true, "details": { "key_type": "ed25519", "sender_match": true, "signature_valid": true }, "verified_at": "2026-03-22T12:00:00Z" }

POST /api/verify/settlement

Verifies a settlement receipt.

Request Body:
{ "receipt": { "settlement_id": "settle_xyz", "amount": "100.0", "proof": "0xabc..." } }
Response:
{ "valid": true, "settlement_confirmed": true }

POST /api/verify/inference

Verifies an inference result with ZK proof.

Request Body:
{ "request_id": "req_abc123", "result": "The capital of France is Paris.", "proof": "0xdef456..." }
Response:
{ "valid": true, "result_verified": true }

GET /api/verify/health

Health check endpoint.

Response:
{ "status": "healthy", "version": "0.1.0" }

GET /api/status

Node status and metrics.

Response:
{ "block_height": 1207, "peer_count": 25, "chain_id": 1337, "sync_status": "synced" }

Error Handling

All APIs return standard JSON-RPC 2.0 error responses:

{ "jsonrpc": "2.0", "error": { "code": -32602, "message": "Invalid params" }, "id": 1 }