Add Hedera session intent#258
Conversation
First native Machine Payments Protocol method for Hedera. Charge intent (draft-hedera-charge-00): - Native Hedera TransferTransaction with Attribution memo - Push mode (type="hash") + pull mode (type="transaction") - Challenge-bound replay protection (same 32-byte memo as Tempo) - Verification via Mirror Node REST API - Splits (atomic multi-recipient, up to 9) Session intent (draft-hedera-session-00): - HederaStreamChannel.sol escrow (ERC-20 payment channels) - EIP-712 cumulative voucher signatures - Open, voucher, topUp, close, requestClose, withdraw - SSE transport for metered streaming (LLM token billing) - 15-minute close grace period Reference implementation: https://github.com/tomrowbo/mppx-hedera npm: mppx-hedera@0.2.1 Deployed contracts (both Sourcify-verified): Testnet: 0x401b6dc30221823361E4876f5C502e37249D84C3 (296) Mainnet: 0x401b6dc30221823361E4876f5C502e37249D84C3 (295)
Renamed subsection "Encoding" to "Memo Encoding" with explicit
anchor {#memo-encoding} to avoid collision with top-level
"Encoding Conventions" section {#encoding}.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
209ca89 to
7d9f033
Compare
brendanjryan
left a comment
There was a problem hiding this comment.
Changes LGTM! Thank you 🙇
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7d9f033 to
f9e3227
Compare
|
Operational notes from running multi-chain MPP-adjacent payment flows on Hedera in production (AlgoVoi gateway, all 7 mainnets + ARC testnet). The streaming-channel approach in this PR composes cleanly with the patterns we operate today, and there's one specific Hedera trade-off worth surfacing. What we operate on Hedera todayAlgoVoi runs three Hedera flows in production:
So we have the allowance-based and the per-cycle-signed patterns in production already. The streaming-channel approach in this PR sits naturally between them: one EIP-712 voucher per request, escrow-bound, with implicit settlement at channel close. Three distinct lifecycles for three distinct merchant needs. On
|
| Pattern | Lifecycle | When to use |
|---|---|---|
| Streaming channel (this PR) | open → N vouchers → close | Per-request metered billing; high-frequency micropayments; agent-bandwidth-as-a-service |
| Subscription intent (#230) | activate → cycle → renew per period | Fixed-amount-per-period; subscription services; SaaS billing |
| Recurring authority (Recurr Tier 2 pattern) | sign allowance → pull on cycle until exhausted | Standing-order pattern; allowance-bounded utility billing |
These don't conflict; they cover different operational needs. A merchant offering an API service could legitimately use all three: streaming for usage-priced inference calls, subscription for the base tier, recurring authority for any add-on capacity prepaid in advance. The cross-method consistency is in the receipt envelope and the JCS canonicalisation rule — same shape regardless of which lifecycle generated the charge.
On EIP-712 voucher domain "Hedera Stream Channel"
Worth checking whether the domain string is rail-portable or Hedera-specific. We hit a real cross-chain pain point on the EIP-712 side: a domain string like "Hedera Stream Channel" is fine for Hedera-only deployments, but a multi-chain merchant offering streaming on Hedera AND Base would need two distinct domain strings to prevent cross-chain replay. Worth a spec note that domain MUST be chain-namespaced (perhaps "MPP Stream Channel - {chainId}" or similar) so implementors don't accidentally make vouchers replayable across chains they didn't intend.
Reference implementation alignment
Happy to coordinate with mppx-hedera on the AlgoVoi-side wallet integration — AlgoVoi's chrome extension wallet has Hedera WC support via Reown (post-2026-05-15 JWT-relay fix), so streaming-channel vouchers could be wallet-signed there too. If your reference implementation needs a chrome-extension-side wallet to test against, AlgoVoi v1.0.3 (released today; in chrome web store review) is ready.
PR reads ready for review from our side; happy to engage on the chain-namespaced domain question or the activation atomicity if useful.
|
+1 on splitting session from charge. The cumulative-voucher pattern fits Hedera's HTS allowance economics well. A few operational notes from running Hedera in production (AlgoVoi gateway, HTS-Approve recurring authorities plus HashPack/Reown WalletConnect for end-user wallets):
Happy to dig into any of these if useful for the spec text. |
|
Thanks for the detailed operational notes — really valuable context from production. On the EIP-712 domain: cross-chain replay is already prevented — the domain separator includes both The token association point is a good one — Would be great to test against the AlgoVoi wallet — will reach out. |
|
Good catch on the EIP-712 point -- you are right that chainId + verifyingContract in the domain separator is doing the real work at the digest level. The note was more about auditability in production logs than any actual replay gap, so a non-normative clarifying sentence would cover it well. Glad the association callout is useful. Worth surfacing early for any implementor who hits the silent failure path before the spec makes it explicit. Looking forward to the wallet test -- happy to coordinate whenever works. |
|
Add my telegram @tomrowbo |
Summary
Streaming payment channel intent for Hedera (
draft-hedera-session-00). ERC-20 escrow with EIP-712 cumulative vouchers — N requests = 2 on-chain transactions.Split from #251 (charge intent) per reviewer request.
Highlights
associateSelfvia precompile at0x167)Voucher(bytes32 channelId, uint128 cumulativeAmount), domain"Hedera Stream Channel"payment-need-voucher+payment-receiptevents for metered streamingDeployed contracts
0x8Aaf...daE0x8Aaf...daEBoth fully verified on Hashscan via Sourcify. USDC: Circle native (0.0.456858 mainnet, 0.0.5449 testnet).
Reference implementation
mppx-hedera(v0.2.2)hak-mppx-hedera-plugin(v1.1.2)Checklist