Add private PSWAP cancellation through a separate account - #3911
Draft
partylikeits1983 wants to merge 8 commits into
Draft
partylikeits1983 wants to merge 8 commits into
partylikeits1983 wants to merge 8 commits into
Conversation
partylikeits1983
added a commit
that referenced
this pull request
Sep 21, 2026
Record the dependency on ajl-pswap-private-paybacks while retaining the complete implementation already tested in PR #3911. The merged tree is identical to 20c7bf9; only the branch ancestry changes. This separates the cancellation, refund, fee-funding, and router-flow review without rewriting the existing pull request history.
partylikeits1983
changed the base branch from
next
to
ajl-pswap-private-paybacks
September 21, 2026 19:24
partylikeits1983
added this pull request to stack #3922
September 22, 2026 10:36
partylikeits1983
force-pushed
the
ajl-pswap-fixed-recipient
branch
from
September 22, 2026 14:15
ea83723 to
d8e2034
Compare
Propagate the output-note sealing dependency from PR #3918 so private cancellation can compile and enforce immutable refunds.
Integrate current next through the payback branch and use the merged sealing implementation. Preserve attachment-free cancellation refunds and verify issuer callbacks cannot alter their assets or add attachments before sealing. Retain current release history, remove superseded callback tests, and refresh PSWAP fill costs with the cancellation dispatcher.
# Conflicts: # crates/miden-testing/tests/scripts/pswap.rs
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.
Adds cancellation to the shielded order flow (private
P2IDpaybacks), stacked on #3918. This implements the cancellation flow in the updated proposal.Cancellation verifies the
RECIPIENThash preimage without requiring the target account (the recipient of theP2ID) to execute the transaction. The user builds and proves the transaction locally through a publicNoAuthaccount. ThePSWAPnote script returns the full remaining balance in a privateP2IDto the committed recipient.Cancellation now checks that the refund contains the full remaining balance and no attachments, then seals it with
output_note::sealfrom #3923. This prevents later mutations to the refund. The kernel sealing API (#3923) and PSWAP output sealing (#3927) are already merged intonext.Knowledge of the hash preimage authorizes cancellation but cannot change the
AccountIddestination of the refund. Cancellation fees are funded separately. Public paybacks and creator reclaim in the unshielded flow remain the same.The private refund should first be committed on chain, then consumed as an authenticated input. Unauthenticated consumption exposes the
NoteIdand links the refund to the consuming account. Timing and funding correlations remain possible.About 70% of this diff is integration tests: invalid preimages and cancellation arguments, private fee funding and change, and the router creation, half-fill, cancellation, and collection flow with local proofs. The rest is mainly the MASM cancellation path, Rust helpers, documentation, and updated benchmark costs. The diff is relative to #3918.
Closes #3909.