@frontiercompute/zap1-ows
v0.1.0
Published
ZAP1 attestation receipts for Open Wallet Standard chain modules
Maintainers
Readme
@frontiercompute/zap1-ows
for a base developer serving an x402-gated resource who wants private zcash settlement plus a zap1 receipt.
install
npm install @frontiercompute/zap1-owsuse
import { attachZap1, x402Receipt } from "@frontiercompute/zap1-ows";
attachZap1(chainModule, { mode: "x402", enabled: walletConfig.zap1 === true });
const receipt = await x402Receipt({
resource: "https://api.example.com/premium",
amount: { value: "1.00", currency: "USDC" },
railTxid: cipherpayTxid,
pcztDigest: signedPcztHash,
walletHash: derivedWalletHash,
base: {
account: "eip155:8453:0x9f7c84d2b4f7b630b3d8c39f0fd9d2df57f1f9a1",
chainId: "eip155:8453",
settlementCurrency: "USDC",
},
});what you get
- emits
X402_PAIDreceipts to zap1 with zero-config trial-key provisioning whenZAP1_API_KEYis absent - carries base-specific metadata for
eip155:8453accounts andUSDCdemand-side settlement into the zcash receipt record - wraps
sign()andsignAndSend()in fire-and-forget mode for generic pczt attestations when you opt intomode: "sign" - returns the zap1 leaf hash when you call the helper directly, but never throws back into the wallet hook path
verifier endpoint
for a base developer or auditor checking that a private zcash settlement anchor actually exists, the canonical surface is:
GET https://api.frontiercompute.cash/verify/{leaf_hash}/checkthat endpoint answers whether the receipt leaf is valid, whether it is anchored, and which zcash mainnet txid and height carry the anchor.
docs snippet
base x402 payment flows can settle privately on zcash without changing the app surface.
emit `X402_PAID` with `@frontiercompute/zap1-ows`.
bridge on the payment rail, anchor the receipt on zcash mainnet, keep the app flow fire-and-forget.
auditors verify at `GET api.frontiercompute.cash/verify/{leaf_hash}/check`.
frontier compute sits under the payment flow as settlement infrastructure, not in the ui.opt-in
call attachZap1() only when your wallet config enables zap1, or pass enabled: false until the user turns it on.
opt-out
skip attachZap1(), pass enabled: false, call the returned detach() handle, or remove the package.
spec
docs: https://api.frontiercompute.cash/docs/
openapi: https://api.frontiercompute.cash/openapi/zap1.yaml
license
mit
