Repository navigation
docs(tempo-session): configurable account voucher signers (TIP-1166) - #408
brendanjryan wants to merge 7 commits into
Conversation
Adds TIP-1166 configurable-account voucher signers to the Tempo session draft (v2 / TIP-1034 precompile): the optional methodDetails.configurableVouchers flag, the voucher signature rules keyed on the signer snapshot from SignerSnapshotCached, the client salt rule, and topUp SignerConfigChanged handling (close and reopen). All additive; defaults keep current behaviour.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 357f46e237
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| signature = 0x05 || rlp([account, config, approvals]) | ||
| config = [salt, version, threshold, owners] | ||
| owner = [address, weight] |
There was a problem hiding this comment.
Extend the payload schema to accept configurable signatures
A server validating credentials against the Session Payload Schema will reject every new 0x05 voucher: its signature property still uses ^0x[0-9a-fA-F]{128,130}$, limiting signatures to 64–65 bytes, whereas this envelope contains an account, a full configuration, and at least one primitive approval. This prevents configurable-account clients from opening or using sessions even when configurableVouchers is advertised. Extend the payload schema and the corresponding signature-length documentation to support the new encoding.
Useful? React with 👍 / 👎.
| servers MUST reject deposits, voucher amounts, settlement amounts, and | ||
| close capture amounts that exceed `2^96 - 1`. | ||
|
|
||
| ### Configurable Account Voucher Signers {#configurable-signers} |
There was a problem hiding this comment.
Bump the modified draft's revision
This change adds protocol requirements but leaves the filename, docname, and frontmatter version at revision 00. The repository's AGENTS.md explicitly requires every modified draft to bump its revision, so rename this draft to draft-tempo-session-01.md and update both frontmatter fields to distinguish the revised specification.
AGENTS.md reference: AGENTS.md:L34-L34
Useful? React with 👍 / 👎.
| on-chain, and returns the `channelId` in the credential. For v2, if the | ||
| voucher signer is a configurable account with a non-zero configuration | ||
| commitment, the client MUST use that commitment as the salt instead | ||
| (see {{configurable-signers}}). |
There was a problem hiding this comment.
Account for registration when selecting the opening salt
When an unregistered configurable account opens its first channel with itself as voucher signer, its on-chain commitment is initially zero, so this procedure selects a random salt. However, a directly 0x05-signed opening transaction registers that account before executing open, making its commitment non-zero before the precompile checks the salt; the transaction consequently reverts with SaltNotSignerCommitment. Specify that clients must use the commitment effective when open executes, including the version-0 commitment installed by the opening transaction itself, rather than treating a zero pre-submission commitment as sufficient to select random entropy. The registration ordering is defined in TIP-1107's Registration section.
Useful? React with 👍 / 👎.
Spec Preview
|
There was a problem hiding this comment.
Findings marked 🟡 are optional suggestions and need no follow-up push.
Additional findings (outside the current diff — GitHub can't attach inline comments there):
-
🟡
specs/methods/tempo/draft-tempo-session-00.md— nit: This draft gains substantive protocol changes but its revision stays-00, which the AGENTS.md rule "A modified draft bumps its revision" forbids. Fix: rename the file todraft-tempo-session-01.mdand setdocname: draft-tempo-session-01andversion: 01.Why this was flagged
AGENTS.md line 34 requires a modified draft to rename its file from
-00to-01and to updatedocnameandversionin the frontmatter. This diff adds about 264 lines of normative rules: new methodDetails, new verification rules and new precompile errors. Lines 4-5 still readdocname: draft-tempo-session-00andversion: 00, and the file name is unchanged. Readers and tools that track draft revisions cannot tell the pre-TIP-1166 text from this one. An earlier commit to this file (#375) also skipped the bump, which shows the rule is not being enforced rather than that it does not apply.Verification: nit. Trigger: any substantive edit to a draft. AGENTS.md:34 says "A modified draft bumps its revision: rename the file (
-00→-01) and updatedocnameandversionin its frontmatter to match."git diff --statshows this PR changes only specs/methods/tempo/draft-tempo-session-00.md (264 insertions, 7 deletions) and does not rename it. The frontmatter at HEAD still readsdocname: draft-tempo-session-00(line 4) andversion: 00(line 5).
…ix salt rule Addresses review on the TIP-1166 session spec changes:\n- Session payload schema: signature pattern now also accepts variable-length 0x05 configurable-account envelopes; the primitive 64/65-byte rule is unchanged. Hex table and signature-format prose updated.\n- Bump the modified draft to draft-tempo-session-01 (file rename, docname, version) and update in-repo references.\n- Client salt rule: use the voucher signer's commitment as of when open executes. TIP-1107 registration of an unregistered configurable account that signs the open transaction runs before open, so the salt is its version-0 commitment, computed locally; an earlier configuration update in the same transaction also counts.
There was a problem hiding this comment.
Still open from earlier reviews (3):
- 🔴
specs/methods/tempo/draft-tempo-session-01.md:1419—On a v2 channel with a non-zero signer snapshot, a server following open verification can accept an initial primitive v… - 🔴
specs/methods/tempo/draft-tempo-session-01.md:1572—Servers can accept primitive vouchers that never settle, and reject valid 0x05 vouchers, on channels with no stored sna… - Also unresolved: 1 blocking on lines changed since (possibly already fixed).
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
Addresses further review on the TIP-1166 session spec changes:\n- Adds a single Voucher Signature Encodings section: v1 stays 65-byte r||s||v or 64-byte EIP-2098; v2 accepts the TIP-1020 primitive encodings (secp256k1 65 bytes, P256 0x01 130 bytes, WebAuthn 0x02 129-2049 bytes) and 0x05 configurable-account signatures, rejecting keychain types. The hex table, escrow Signature Verification, open payload note, Signature Malleability and payload schema now reference it.\n- Open verification: for v2 the initial voucher gets every voucher-verification rule regardless of signature type (keychain rejected, primitive rejected when the signer snapshot is non-zero).\n- Client signing: on zero-snapshot channels clients keep signing primitive vouchers that recover to the signer, and sign 0x05 only for an unregistered configurable account whose version-0 configuration derives the signer address; configurableVouchers is required only when signing 0x05.
There was a problem hiding this comment.
2 optional suggestions (nits or notes on pre-existing code) were found and not posted.
The last 3 reviews of this pull request each found new blocking issues, repeatedly in specs/methods/tempo/draft-tempo-session-01.md. Where they share a root cause, one fix may close them together.
Still open from earlier reviews (2):
- 🔴
specs/methods/tempo/draft-tempo-session-01.md:4—After merge, the "Defined In" link on all eight session/* problem pages on paymentauth.org will 404. The deploy now pub… - 🔴
specs/methods/tempo/draft-tempo-session-01.md:1625—Servers can accept primitive vouchers that never settle, and reject valid 0x05 vouchers, on channels with no stored sna…
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
Address review findings on the TIP-1166 voucher rules: - Give v2 one signature rule (65-byte secp256k1, P256, WebAuthn, 0x05) at every site: the byte-array table, voucher verification, Signature Malleability (with the P256 half-order) and the JSON Schema; v1 stays 64/65 bytes. - Clients sign 0x05 on a zero-snapshot channel only when a version-0 configuration derives the signer's address, and otherwise keep signing primitive vouchers; the configurableVouchers gate applies only to opens that will sign 0x05 vouchers. - Add Signer Snapshot Lookup: a missing snapshot is unknown, never zero. Servers look it up from SignerSnapshotCached logs filtered by the indexed channelId (no log means zero) before verifying a v2 voucher, and cache it by channelId across sessions. Close vouchers are verified the same way. - Link problem pages to each draft's latest revision, so the session problem pages point at draft-tempo-session-01.
There was a problem hiding this comment.
Code review found no new issues
No new issues were found in this update; 1 finding from earlier reviews is still open above.
1 optional suggestion (a nit or a note on pre-existing code) was found and not posted.
Still open from earlier reviews (1):
- 🔴
specs/methods/tempo/draft-tempo-session-01.md:1405—Payers with a P256 or WebAuthn voucher signer can lock a deposit with a server that rejects every voucher they sign. Th…
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
Keep v2 primitive voucher signatures secp256k1-only (64 or 65 bytes, as in -00) so -01 clients stay interoperable with -00 servers, and admit only 0x05 additionally, gated by configurableVouchers: - Clients MUST NOT send P256 or WebAuthn voucher signatures; servers MUST reject them along with keychain and unknown types. - Servers that accept a 64-byte compact signature expand it to 65 bytes before settle or close, since TIP-1020 takes secp256k1 only as 65. - Owner approvals inside 0x05 follow TIP-1107 unchanged. - Revert the widening in the byte-array table, voucher verification, Signature Malleability and the JSON Schema pattern.
Follow TIP-1166 on tempoxyz/tempo main: the event is now OpeningCommitmentRecorded (tempoxyz/tempo#9422) and servers may check vouchers with the verifyVoucher view (tempoxyz/tempo#9420).
| Alternatively, servers MAY check a v2 voucher signature by calling the | ||
| escrow precompile's `verifyVoucher(descriptor, cumulativeAmount, | ||
| signature)` view, which returns whether `settle` and `close` would | ||
| accept the signature, applying the rules in {{configurable-signers}} | ||
| against the channel's opening commitment {{TIP-1166}}. A server that | ||
| uses it need not know the opening commitment. The view reverts with | ||
| `ChannelNotFound()` if the channel does not exist and does not compare | ||
| `cumulativeAmount` with the deposit or the settled amount, so servers | ||
| MUST still apply the other checks in this section, including rejecting | ||
| `0x05` signatures when they do not advertise `configurableVouchers`. |
There was a problem hiding this comment.
🔴 Servers that use the new verifyVoucher shortcut reject valid 64-byte compact vouchers and accept P256/WebAuthn vouchers the draft says servers MUST reject. The view applies precompile rules, which differ from {{signature-encodings}} at two points. TIP-1020 takes secp256k1 only as exactly 65 bytes, and the precompile accepts P256/WebAuthn. Fix: require servers to apply the {{signature-encodings}} rules before calling the view. That means rejecting every type except 65/64-byte secp256k1 and 0x05, and expanding a 64-byte compact signature to 65-byte r || s || v, as line 1444 already requires before settle/close.
Why this was flagged
The trigger is a v2 server that takes the MAY path at lines 1587-1596 and calls verifyVoucher(descriptor, cumulativeAmount, signature) with the signature as received. A client sends a 64-byte EIP-2098 compact secp256k1 voucher. Line 2126 and the v2 sentence after it say v2 accepts this format, and line 1446 only says clients SHOULD send 65 bytes. Lines 1442-1444 say TIP-1020 accepts secp256k1 only as exactly 65 bytes, and they require expansion only before settle/close, not before verifyVoucher. So the view returns false and the server rejects a voucher the draft defines as valid. In the other direction, line 449 says the precompile accepts P256 and WebAuthn, so the view returns true for them. But the safeguard at lines 1595-1596, "apply the other checks in this section", points only at the voucher-verification section, which never lists the P256/WebAuthn rejection. On the base branch, and before this push, there was no verifyVoucher path, and signature handling followed {{signature-encodings}} alone.
Verification: Lines 1587-1590 say the view "returns whether settle and close would accept the signature". Lines 1442-1445 say TIP-1020 "accepts secp256k1 only as exactly 65 bytes", with expansion required only before settle or close. Line 1429 says v2 accepts "65 or 64 bytes". Base -00 had no view path, so this cannot happen there.
Draft revisions aren't protocol versions; keep draft-tempo-session-00 and drop the rename, reference updates and latest-revision problem-page linking that only the bump needed.
There was a problem hiding this comment.
Code review found no new issues
No new issues were found in this update; 1 finding from earlier reviews is still open above.
Still open from earlier reviews (1):
- 🔴
specs/methods/tempo/draft-tempo-session-00.md:1596—Servers that use the new verifyVoucher shortcut reject valid 64-byte compact vouchers and accept P256/WebAuthn vouchers…
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
What
Adds TIP-1166 configurable-account voucher signers to the Tempo session draft (
specs/methods/tempo/draft-tempo-session-00.md, edited in place without a revision bump; see #406). It only changes v2 sessions on the TIP-20 channel escrow precompile (TIP-1034).methodDetails.configurableVouchers(optional boolean, defaultfalse): servers set it totruewhen they accept0x05configurable-account voucher signatures. A client whose voucher signer is a configurable account MUST NOT open a channel unless it istrue, so a deposit is never locked with a server that would reject its vouchers. Added to the method details table, the JSON schema and a request example.0x05signatures whose configuration hashes to the opening commitment are accepted. With a zero opening commitment, a0x05signature needs a version-0 configuration that derives the signer's address, and a primitive signature must recover to the signer. The draft also covers the0x05encoding and the owner digestkeccak256("tempo:configurable-account:signature" || signingHash || account || uint64be(version)).OpeningCommitmentRecorded(channelId, signer, commitment)from the open receipt (it must matchdescriptor.saltand the voucher signer), store it per channel asopeningCommitment(missing means zero) and check0x05configurations against it, never against the current commitment. Primitive vouchers on a channel with a non-zero opening commitment are rejected because they can never settle.openexecutes, when non-zero. That includes TIP-1107 registration of an unregistered configurable account that signs the open transaction (the salt is then its version-0 commitment, computed locally) and any configuration update earlier in the same transaction.signaturepattern also accepts variable-length0x05envelopes; the 64/65-byte primitive rule is unchanged.topUpreverts withSignerConfigChanged(signer)after the signer's configuration changes, orRootKeyRetired(signer)if a signer with a zero opening commitment became configurable. Clients do not retry; they close the channel and reopen. Existing vouchers stay settleable.Why
From T15, the channel reserve precompile lets configurable accounts sign vouchers, checked against the owner configuration fixed in the channel salt at open. Protocol change: tempoxyz/tempo#9293. TIP text: tempoxyz/tempo#9133 (
tips/tip-1166.md). This PR depends on tempoxyz/tempo#9293 landing for T15. Servers should only advertiseconfigurableVouchersonce T15 is live.Backward compatibility
Every change is additive. If
configurableVouchersis missing, it meansfalse. Channels with noOpeningCommitmentRecordedevent have a zero opening commitment, so primitive vouchers behave as before. v1 channels, thechannelIdderivation, the voucher EIP-712 format and the existing payload shapes are unchanged. Clients whose signer is not configurable must not require the flag.Checks
rfclint --no-rng --no-spelloutput and the lines over 72 characters matchmainexactly.scripts/lint_json_examples.py,lint_frontmatter.py,lint_external_section_refs.py,lint_examples.pyandlint_problem_types.pyall pass.