每个响应由它签名,每次调用付一张链下凭证,进一条只属于这个 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.
今天的网站要调用服务,必须连上某家公司的服务器。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.
超出这些值的行为由合约或规范直接拒绝
Beyond these values the contract or the spec refuses outright
| 符号Symbol | 参数Parameter | 值Value | 依据Source |
|---|---|---|---|
| MAX_CONTRIBUTION | 自愿贡献比例上限Voluntary contribution cap | 5000 bps | TAP-22 |
| MAX_PAYLOAD | TapeSend 单条消息TapeSend message | 16 000 B | TAP-10 |
| CHUNK | DeWEB 单块写入DeWEB chunk write | 24 000 B | SPEC B.5 |
| FILE_MAX | DeWEB 单文件DeWEB single file | 8.4 MB | SPEC B.5 |
| EVAL_GAS | 链上电路重算上限On-chain circuit re-evaluation | 12 M ≈ 4 800 gates | TAP-25 |
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 / window | 48 h / 7 d | 窗口外须重新申请Re-request outside the window |
| t_SES | 会话密钥最长有效期Session key maximum lifetime | 30 d | 按通道授权,无撤销,泄露损失以一个通道为上限Per channel, no revoke; a leak is bounded by one channel |
| G_SET | 一次链上结算One on-chain settlement | 88 998 gas ≈ $0.0034 | 覆盖此前任意多次调用Covers any number of prior calls |
| G_CALL | 单次调用 gasGas per call | 0 | 凭证在链下签发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.
两份已验证信封的比较结果。这是 TapeAPI 最重要的一条规则。
Comparing two verified envelopes. This is the most important rule in TapeAPI.
| 提供者 A 应答A answered | 提供者 B 应答B answered | 签名有效Signatures valid | 结果一致Results identical | 输出Output |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 采信ACCEPT |
| 1 | 1 | 1 | 0 | 拒绝REJECT |
| 1 | 1 | 0 | × | 拒绝REJECT |
| 1 | 0 | 1 | × | 拒绝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.
一份配置把现有 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.
不需要委员会的可验证数据源,以及不锁资金池的跨链询价。价格按容差比较,因为跨源价格永远不会字节相同。
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.
存档与排行榜跟着玩家的容器走。回合结算规则可以是一枚电路,任何人都能在链上重算。
Saves and leaderboards follow the player's container. A round's settlement rule can be a circuit anyone re-evaluates on chain.
发布一个带签名的读取服务,TapeOut 生态的应用无需跨链桥即可读你的链,结果锚定在具体区块哈希上。
Publish a signed read service and every TapeOut app can read your chain with no bridge, anchored to a specific block hash.
// 解析身份,验签,要求两家独立提供者一致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)
| 项目Item | 收费方Charged by | 金额Amount |
|---|---|---|
| 解析身份、读清单、验签Resolve, read manifest, verify | 无Nobody | 0 |
| TapeAPI 协议费TapeAPI protocol fee | 无Nobody | 0 |
| 自愿维护贡献Voluntary maintenance contribution | 提供者自设Provider sets it | 默认 0,建议 1%Default 0, suggested 1% |
| 服务调用价Service call price | 提供者Provider | 自定Provider's choice |
| 开通一个容器Opening a container | TapeOut | 0.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.