TAPEAPI Rev 0.4 2026-09-25 BNB Smart Chain · 56

流片一枚电路,它的容器就是你的 API

Tape out a circuit, and its container is your API

每个响应由它签名,每次调用付一张链下凭证,进一条只属于这个 API 的通道。DeWEB 是网站,TapeSend 是通信,TapeAPI 是服务。

Every response signed by it, every call paid with an off-chain voucher into a channel that belongs to that API alone. DeWEB is websites, TapeSend is communication, TapeAPI is services.

PRELIMINARY 规范 CC0 · 代码 MIT · 合约未部署 · 未经审计 Spec CC0 · Code MIT · Not deployed · Not audited
01

特性与说明

Features and Description

  • 免费服务零部署不需要我们的任何合约
  • Zero deploymentA free service needs none of our contracts
  • 身份不可自述由链上推导,客户端强制重算
  • Identity cannot be self-assertedDerived on chain; clients re-derive it
  • 答案带签名摘要覆盖方法与参数,签过名的错误无法被改标成成功
  • Signed answersThe digest covers method and params, so an error cannot be relabelled
  • 一次调用零 gas累计凭证进只属于该 API 的通道,多次调用一笔结算
  • No gas per callCumulative vouchers into a channel that belongs to that API alone; many calls settle at once
  • 零协议费贡献由提供者自设,默认 0
  • Zero protocol feeContribution is provider-set, default zero
  • 多方一致任意两份已验证答案不一致即拒绝,永不多数决
  • QuorumAny disagreement rejects; never a majority vote

今天的网站要调用服务,必须连上某家公司的服务器。TapeAPI 把服务本身变成一个链上身份:一枚 TapeOut 电路、它的 ERC-6551 容器,以及存在容器站点里的一份服务清单。

A website that needs a service today must reach a company's server. TapeAPI turns the service itself into an on-chain identity: one TapeOut circuit, its ERC-6551 container, and a manifest stored in that container's site.

调用走普通 HTTPS,所以和现有 API 一样快。区别在于响应由容器绑定的密钥签名,调用方可以验签,也可以要求两家互不相干的提供者给出一致答案才采信。

Calls go over ordinary HTTPS, so they are as fast as any API. The difference is that the response is signed by a key bound to the container, and the caller can verify it, or require two unrelated providers to agree before believing it.

付费用离线签发的累计凭证,提供者攒够了再上链结算一次。调用本身不花 gas。

Payment uses off-chain cumulative vouchers; the provider settles once on chain when it is worth doing. The call itself costs no gas.

02

功能框图

Functional Block Diagram

DeWEB TapeSend TapeAPI PAGES MESSAGES SERVICES CIRCUIT NFT ERC-6551 CONTAINER 12 34 HOLDER SIGNER KEY MANIFEST
图 1三层共用同一个身份:一枚电路的容器。持有人签一次委托,服务此后用自己的热密钥签名答案;转让电路即转让服务。
Fig. 1Three layers share one identity: a circuit's container. The holder signs a delegation once; the service then signs answers with its own key. Transferring the circuit transfers the service.
03

极限参数

Absolute Maximum Ratings

超出这些值的行为由合约或规范直接拒绝

Beyond these values the contract or the spec refuses outright

符号Symbol 参数Parameter 值Value 依据Source
MAX_CONTRIBUTION自愿贡献比例上限Voluntary contribution cap5000 bpsTAP-22
MAX_PAYLOADTapeSend 单条消息TapeSend message16 000 BTAP-10
CHUNKDeWEB 单块写入DeWEB chunk write24 000 BSPEC B.5
FILE_MAXDeWEB 单文件DeWEB single file8.4 MBSPEC B.5
EVAL_GAS链上电路重算上限On-chain circuit re-evaluation12 M ≈ 4 800 gatesTAP-25
04

时序与运行特性

Timing and Operating Characteristics

gas 为本地实测;法币按 BNB 753 美元、BSC 0.05 gwei 换算

Gas measured locally; fiat at BNB $753 and BSC 0.05 gwei

符号Symbol 参数Parameter 典型值Typical 条件Condition
t_WD提现冷静期 / 执行窗口Withdraw cooldown / window48 h / 7 d窗口外须重新申请Re-request outside the window
t_SES会话密钥最长有效期Session key maximum lifetime30 d按通道授权,无撤销,泄露损失以一个通道为上限Per channel, no revoke; a leak is bounded by one channel
G_SET一次链上结算One on-chain settlement88 998 gas ≈ $0.0034覆盖此前任意多次调用Covers any number of prior calls
G_CALL单次调用 gasGas per call0凭证在链下签发Vouchers are signed off chain
N_Q采信所需一致提供者数Providers required to agree≥ 2须互相独立Mutually independent

关于摊销。一次结算 0.0034 美元。若每 1000 次调用结算一次,单价 0.001 BEM 时 gas 占收入 3.35%,0.01 BEM 时占 0.34%。gas 不是定价的约束,提供者的边际成本才是。

On amortisation. One settlement costs $0.0034. Settling every 1000 calls, gas is 3.35% of revenue at 0.001 BEM per call and 0.34% at 0.01 BEM. Gas does not constrain the price; the provider's marginal cost does.

05

一致性真值表

Agreement Truth Table

两份已验证信封的比较结果。这是 TapeAPI 最重要的一条规则。

Comparing two verified envelopes. This is the most important rule in TapeAPI.

提供者 A 应答A answered 提供者 B 应答B answered 签名有效Signatures valid 结果一致Results identical 输出Output
1111采信ACCEPT
1110拒绝REJECT
110×拒绝REJECT
101×拒绝REJECT

没有多数决。三家里两家一致、一家不同,默认结果是拒绝。理由:多数决在三取二时可被合谋伪造,而拒绝只会让调用失败。调用方可以显式降级,但那是它自己的选择。

There is no majority vote. Two of three agreeing with one dissenting is a rejection by default. A majority rule is forgeable by two colluding providers out of three; rejection only denies. A caller may opt into the weaker mode explicitly, but that is its own decision.

06

典型应用

Typical Applications

APP 01

Web2 企业

Web2 company

一份配置把现有 REST 端点变成按次计费的服务,收入直接进你的链上身份,无需开户系统。

One config turns an existing REST endpoint into a pay-per-call service. Revenue lands on your on-chain identity; no accounts to manage.

APP 02

DeFi 协议

DeFi protocol

不需要委员会的可验证数据源,以及不锁资金池的跨链询价。价格按容差比较,因为跨源价格永远不会字节相同。

A verifiable data source without a committee, and cross-chain quoting without a pooled bridge. Prices compare within a tolerance, since cross-source prices are never byte-identical.

APP 03

游戏

Games

存档与排行榜跟着玩家的容器走。回合结算规则可以是一枚电路,任何人都能在链上重算。

Saves and leaderboards follow the player's container. A round's settlement rule can be a circuit anyone re-evaluates on chain.

APP 04

公链与 L2

Chains and L2s

发布一个带签名的读取服务,TapeOut 生态的应用无需跨链桥即可读你的链,结果锚定在具体区块哈希上。

Publish a signed read service and every TapeOut app can read your chain with no bridge, anchored to a specific block hash.

07

典型应用电路

Typical Application Circuit

// 解析身份,验签,要求两家独立提供者一致Resolve, verify, require two independent providers to agree
import { createTapeAPI } from '@tapeapi/sdk'

const api = createTapeAPI({ rpcUrls: RPC_URLS, quorum: 2, chainId: 56 })

// 按容器地址解析,不需要任何目录合约Resolve by container address; no directory contract needed
const a = await api.resolve('0x86DD…eA95')
const b = await api.resolve('0x91Fa…7c02')

// 钉同一个区块,两家的答案才可比较Pin one block so the answers are comparable
const block = await api.rpc.blockNumber()
const r = await api.callQuorum([a, b], 'bnbUsd', { block })

// r.verified 为真 = 两份信封各自验签通过,且结果逐字节相同r.verified means both envelopes verified and the results matched byte for byte
console.log(r.result.bnbUsd, r.agreed)
图 2最小调用回路。免费方法到此为止;付费方法再加一个 payer,凭证在本地签发,不产生链上交易。
Fig. 2Minimum call loop. That is all a free method needs; a paid one adds a payer that signs vouchers locally, with no on-chain transaction.
08

费用

Cost of Operation

项目Item 收费方Charged by 金额Amount
解析身份、读清单、验签Resolve, read manifest, verify无Nobody0
TapeAPI 协议费TapeAPI protocol fee无Nobody0
自愿维护贡献Voluntary maintenance contribution提供者自设Provider sets it默认 0,建议 1%Default 0, suggested 1%
服务调用价Service call price提供者Provider自定Provider's choice
开通一个容器Opening a containerTapeOut0.012 BNB

合约里没有任何我们能调的费率开关。贡献由提供者自己设、默认为 0、不给功能完全一样。TAP-22 明写其它托管部署同样合规。

There is no operator fee switch anywhere in the contracts. The contribution is provider-set, defaults to zero, and refusing it changes nothing. TAP-22 states that alternative escrow deployments are equally conforming.

09

规范索引

Specification Index

TAP-1TAP 流程与编号TAP purpose and processDraft
TAP-20服务身份与清单Service identity and manifestDraft
TAP-21签名响应信封Signed response envelopeDraft
TAP-22计量支付凭证与托管Metered vouchers and escrowDraft
TAP-23带证明的跨链读取Attested readDraft
TAP-24跨链意图询价Intent RFQDraft
TAP-25可由电路验证的方法Circuit-verified methodsDraft
TAP-26容器间的私密通道Private channels between containersDraft
TAP-27容器间的私密群聊Private groups between containersDraft