Skip to content

docs(tempo-session): configurable account voucher signers (TIP-1166) - #408

Open
brendanjryan wants to merge 7 commits into
mainfrom
feat/tip-1166-configurable-vouchers
Open

brendanjryan wants to merge 7 commits into
mainfrom
feat/tip-1166-configurable-vouchers

Conversation

@brendanjryan

@brendanjryan brendanjryan commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

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, default false): servers set it to true when they accept 0x05 configurable-account voucher signatures. A client whose voucher signer is a configurable account MUST NOT open a channel unless it is true, 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.
  • Voucher signature rules follow the TIP-1166 table: keychain signatures are never accepted. With a non-zero opening commitment, only 0x05 signatures whose configuration hashes to the opening commitment are accepted. With a zero opening commitment, a 0x05 signature needs a version-0 configuration that derives the signer's address, and a primitive signature must recover to the signer. The draft also covers the 0x05 encoding and the owner digest keccak256("tempo:configurable-account:signature" || signingHash || account || uint64be(version)).
  • Opening commitment: servers read OpeningCommitmentRecorded(channelId, signer, commitment) from the open receipt (it must match descriptor.salt and the voucher signer), store it per channel as openingCommitment (missing means zero) and check 0x05 configurations 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.
  • Client salt rule: for a new v2 channel, salt is the voucher signer's configuration commitment as of when open executes, 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.
  • Payload schema: the signature pattern also accepts variable-length 0x05 envelopes; the 64/65-byte primitive rule is unchanged.
  • topUp: a non-zero topUp reverts with SignerConfigChanged(signer) after the signer's configuration changes, or RootKeyRetired(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.
  • Adds the new precompile event and errors, terminology entries, TIP-1034, TIP-1107 and TIP-1166 references, and a Security Considerations subsection.

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 advertise configurableVouchers once T15 is live.

Backward compatibility

Every change is additive. If configurableVouchers is missing, it means false. Channels with no OpeningCommitmentRecorded event have a zero opening commitment, so primitive vouchers behave as before. v1 channels, the channelId derivation, the voucher EIP-712 format and the existing payload shapes are unchanged. Clients whose signer is not configurable must not require the flag.

Checks

  • Built the draft with kramdown-rfc 1.7.39 and xml2rfc (text). The kramdown-rfc warnings, the rfclint --no-rng --no-spell output and the lines over 72 characters match main exactly.
  • scripts/lint_json_examples.py, lint_frontmatter.py, lint_external_section_refs.py, lint_examples.py and lint_problem_types.py all pass.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T16:39:52.650534Z 357f46e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +444 to +446
signature = 0x05 || rlp([account, config, approvals])
config = [salt, version, threshold, owners]
owner = [address, weight]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +740 to +743
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}}).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@github-actions

Copy link
Copy Markdown

Spec Preview

Spec Changed Artifacts
draft-card-charge-00 Yes HTML · TXT · XML · PDF
draft-evm-charge-00 Yes HTML · TXT · XML · PDF
draft-evm-session-00 Yes HTML · TXT · XML · PDF
draft-hedera-charge-00 Yes HTML · TXT · XML · PDF
draft-hedera-session-00 Yes HTML · TXT · XML · PDF
draft-httpauth-payment-01 Yes HTML · TXT · XML · PDF
draft-lightning-charge-00 Yes HTML · TXT · XML · PDF
draft-lightning-session-00 Yes HTML · TXT · XML · PDF
draft-nearintents-charge-01 Yes HTML · TXT · XML · PDF
draft-payment-discovery-01 Yes HTML · TXT · XML · PDF
draft-payment-intent-charge-00 Yes HTML · TXT · XML · PDF
draft-payment-intent-subscription-00 Yes HTML · TXT · XML · PDF
draft-payment-transport-mcp-00 Yes HTML · TXT · XML · PDF
draft-solana-charge-00 Yes HTML · TXT · XML · PDF
draft-solana-session-00 Yes HTML · TXT · XML · PDF
draft-solana-subscription-00 Yes HTML · TXT · XML · PDF
draft-stellar-charge-00 Yes HTML · TXT · XML · PDF
draft-stripe-charge-00 Yes HTML · TXT · XML · PDF
draft-stripe-subscription-00 Yes HTML · TXT · XML · PDF
draft-tempo-charge-00 Yes HTML · TXT · XML · PDF
draft-tempo-session-00 Yes HTML · TXT · XML · PDF
draft-tempo-subscription-00 Yes HTML · TXT · XML · PDF
draft-usdc-charge-00 Yes HTML · TXT · XML · PDF
draft-xrpl-charge-00 Yes HTML · TXT · XML · PDF
draft-xrpl-session-00 Yes HTML · TXT · XML · PDF

Browse preview release assets

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to draft-tempo-session-01.md and set docname: draft-tempo-session-01 and version: 01.

    Why this was flagged

    AGENTS.md line 34 requires a modified draft to rename its file from -00 to -01 and to update docname and version in the frontmatter. This diff adds about 264 lines of normative rules: new methodDetails, new verification rules and new precompile errors. Lines 4-5 still read docname: draft-tempo-session-00 and version: 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 update docname and version in its frontmatter to match." git diff --stat shows 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 reads docname: draft-tempo-session-00 (line 4) and version: 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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open from earlier reviews (3):

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted.

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).

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 optional suggestion (a nit or a note on pre-existing code) was found and not posted.

Comment on lines +1587 to +1596
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`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants