Repository navigation
Description
Summary
The node currently accepts EOA pool owners only. ClientHandler::intake_capability verifies the pool owner's capability signature off-chain with a plain 65-byte ecrecover and drops any non-65-byte (ERC-1271 / contract-wallet) owner signature (crates/node/src/handlers/client/mod.rs:791, docstring at :764 — "this design does not accept contract wallets as pool owners"). The PaymentPool contract itself already supports contract owners via SignatureChecker.isValidSignatureNow in _registerCapability, so this is a node-side functional gap, not a contract one.
Consequence: Safe / smart-account-owned pools do not work with this node — their capabilities are rejected at intake and never served or redeemed. Supporting them (a stated design goal for Safe-owned pools) requires node-side ERC-1271 verification.
What adding ERC-1271 support involves
- Node-side owner verification must move on-chain for contract owners. An ERC-1271 signature can't be recovered off-chain, so intake would call the owner's
isValidSignature(viaeth_call/SignatureChecker) instead ofecrecoverwhen the owner is a contract. The wire already carries variable-length owner sigs (WireCapability.owner_signature: Vec<u8>,crates/protocol/src/client.rs:269); the 65-byte pin is only at intake. - Keep the EOA fast-path; branch to the on-chain check only for contract owners.
⚠️ Gas concerns — these are the hard part, not the plumbing
A contract owner's isValidSignature runs owner-controlled code during on-chain _registerCapability, which happens inside redeemMany on a signer's first redemption. This introduces gas the redeemer (the node) pays and cannot bound:
- Unbounded registration gas. A malicious ERC-1271 owner can make
isValidSignatureburn arbitrary gas before returning valid. Registration fires once per signer, on first redemption — which for the one-time-payer workload is every lane. - Breaks the redemption chunk-sizing invariant.
redeem_max_vouchers_per_tx(default 300) is sized on a bounded per-lane cost — currently ~63.4k gas for a first-time EOA-owner lane (test_redeemMany_gas_firstTime_*,contracts/test/PaymentPool.t.sol; see theDEFAULT_REDEEM_MAX_VOUCHERS_PER_TXdoc comment). A gas-bomb lane has no such bound: it costs a fixed huge amount regardless of chunk size, so the reactive halve-retry insubmit_chunkcannot rescue it — split down to a one-lane chunk and it still won't fit a block → that lane becomes permanently un-redeemable (node served it, can't collect) and is a general griefing vector (force outsized gas or abandon the claim). - Oversized
ownerSigcalldata. ERC-1271 sigs are unboundedbytes; a large blob inflates calldata gas (16 gas/byte) even with an execution-gas cap.
Note: the redeem half stays safe regardless — voucher signers are forced EOAs (ecrecover, ~3k, per #1701). Only the registration half is exposed, and only for contract owners.
Required mitigations for any ERC-1271 support
- Node-side registration-cost guard at intake:
eth_estimateGasthe on-chain registration before accepting a contract-owner lane and reject abusively expensive owners; cap acceptedownerSiglength; optionally allow-list known-good wallet implementations (e.g. Safe singletons). - Contract-side bound (defense-in-depth): cap gas forwarded to the ERC-1271 call (
isValidSignatureNow{gas: CAP}) — generous enough for legit Safe threshold checks — and a maxownerSiglength.
Related
- Surfaced during PR feat(payments): chunk voucher redemption into gas-bounded redeemMany transactions #1704 (voucher-redemption chunking), whose
redeem_max_vouchers_per_txsizing assumes a bounded per-lane cost. - Adjacent to the serve-time over-subscription / refundable-floor
Mgriefing surface: a malicious owner cheaply forcing the node into uneconomic work is the same shape. Consider designing the registration-cost guard alongside that work.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
feat(payments): chunk voucher redemption into gas-bounded redeemMany …
alpergundogdu commentedon Nov 25, 2026
Superseded by #2993. Capability signatures become ECDSA only, so nodes keep plain
ecrecoverand no ERC-1271 owner check reaches intake or registration. A Safe owner delegates signing withsetIssuerinstead.