Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the
nearintentssession draft into version 2 of its challenge and credential formats. It closes a weakness in the current spec: every 402 carried a live quote, and the client named its session key and refund destination only inopen, after depositing. The deposit hash is public, so a copy of the challenge was enough to open the session with another key and take the deposit as the refund. This was found while building a prototype against the spec.Only
draft-nearintents-session-00changes. The core draft, the charge draft andscripts/gen_problems.pyare untouched.Session:
draft-nearintents-session-00, edited in placemethodDetails.version: 2, as STYLE.md asks for a breaking method change. The single-step flow is withdrawn.quoteaction. New and unsigned. The client names its session key, refund destination, deposit asset, origin refund address and the value to fund. The server answers 402 withpayment-action-requiredand the payable challenge.openno longer carries the key or the refund destination; they come from the challenge, and only the bound key can open. A top-up challenge is bound to its session, and the unauthenticated top-up path is removed.voucherechoes a current challenge of the requested resource,closeany current session challenge. Their signatures do not cover it, so an expired challenge is replaced without signing again.funding.deadlineis the deposit cutoff. The challengeexpiresat least 24 hours later, so no credential is ever presented for an expired challenge, as the core draft requires.INCOMPLETE_DEPOSITis pending, not terminal. The payable challenge, not the transaction hash, is the unit of settlement. Servers complete a detected top-up on their own.minDeposit(required) andmaxFunded(optional); the client chooses the deposit size within them.mpp-nearintents-session-v2. The five test vectors are regenerated from the published test seed.quoteactions are rate limited), and a note on value passing through the merchant's account.session/insufficient-valueis attributed to the session intent, matchinggen_problems.py. The credential header follows the field selection of feat(core): define how Payment composes with other authentication #404. Session challenges do not carrydigest.Points worth a reviewer's attention
quotecredential is answered with a 402 and a new challenge, not a receipt.quoteaction is unsigned. The protection is the binding in the payable challenge, which the client verifies before paying and the server enforces atopen.expiresis the end of the claim window, not the quote deadline as in the charge draft.draft-nearintents-charge-01: the origin refund address always comes from the payer,INCOMPLETE_DEPOSITis not terminal, and no transaction hash is claimed as in-flight.Compatibility
Breaking for implementations of the earlier text. None is known in production; the one prototype is being updated.
Still depends on #394 for the session intent this draft implements.
Significant AI assistance (Claude Code) was used in drafting and reviewing this change, including one independent adversarial review pass; all content was reviewed by the author.