Skip to content

Conversation

@sug0
Copy link
Collaborator

@sug0 sug0 commented Oct 22, 2025

Describe your changes

Closes #4830
Closes #4168

Allow IBC deposits into payment addresses (without generating MASP transactions), and IBC withdraws from payment addresses (to automatically get refunded, if an IBC unshielding transfer fails on the counter-party).

These changes should substantially improve the UX of MASP over IBC.

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo

@sug0 sug0 added IBC UX MASP breaking-change breaking:consensus Consensus breaking change that requires a hard-fork do-not-merge Do not merge for now labels Oct 22, 2025
@sug0 sug0 requested review from grarco, murisi and yito88 October 22, 2025 17:55
@mergify
Copy link
Contributor

mergify bot commented Oct 22, 2025

🧪 CI Insights

Here's what we observed from your CI run for ed70e61.

🟢 All jobs passed!

But CI Insights is watching 👀

@brentstone brentstone added this to the Next Release milestone Oct 24, 2025
@sug0 sug0 force-pushed the tiago/znam-ibc-shielding branch 2 times, most recently from 471aea1 to ab45ed0 Compare October 27, 2025 20:56
@sug0 sug0 force-pushed the tiago/znam-ibc-shielding branch from ab45ed0 to 2f12d8b Compare October 30, 2025 14:45
sug0 added a commit that referenced this pull request Oct 30, 2025
sug0 added a commit that referenced this pull request Nov 6, 2025
@sug0 sug0 force-pushed the tiago/znam-ibc-shielding branch from 4dde27b to 12e9a55 Compare November 6, 2025 13:07
@sug0
Copy link
Collaborator Author

sug0 commented Nov 6, 2025

oops, I broke something between the last two f-pushes

}

/// Source of the MASP data we are validating.
enum MaspSource {
Copy link
Collaborator

@murisi murisi Nov 6, 2025

Choose a reason for hiding this comment

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

Thanks for your work on this. The code seems okay to me. Since it's been a while since I've looked at this code, I just have one or two basic questions: This PR allows IBC deposits into payment addresses (without generating MASP transactions). Is the main benefit of doing this avoiding having to generate zero-knowledge proofs, or is it something else? Is the main change of this PR that transaction notes are submitted in a vector instead of an actual Transaction object? Or is the change more fundamental? I think I have more questions/comments, but just want to make sure that I am understanding things right.

Copy link
Collaborator Author

@sug0 sug0 Nov 7, 2025

Choose a reason for hiding this comment

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

Is the main benefit of doing this avoiding having to generate zero-knowledge proofs, or is it something else?

The immediate benefits I can think of are a few:

  1. Avoiding generating zero-knowledge proofs when depositing via IBC
    i. This translates to less time to process the tx
  2. Forgoing the need to include the generated MASP transaction in the memo field of the IBC transaction
    i. This translates to cheaper txs on the counterparty chain, and cheaper IBC relaying fees
  3. Refunding failed IBC unshielding transactions back to a payment address
    i. Better UX, no need to manually shield refunds

Is the main change of this PR that transaction notes are submitted in a vector instead of an actual Transaction object?

In this PR, notes are generated by the protocol, the user doesn't submit any MASP data other than a payment address. This is possible due to the fact the submitted IBC ICS-20 packet data already has the necessary information to build a plaintext MASP note. Some of the other changes in the PR are required to figure out if an asset is part of the rewards program, emitting events for clients to pick up the notes minted by the protocol while syncing their local MASP state, etc.

sug0 added a commit that referenced this pull request Nov 7, 2025
@sug0 sug0 force-pushed the tiago/znam-ibc-shielding branch from 12e9a55 to 12c5530 Compare November 7, 2025 10:11
@sug0 sug0 requested a review from grarco November 7, 2025 10:12
@sug0 sug0 force-pushed the tiago/znam-ibc-shielding branch from 12c5530 to ed70e61 Compare November 7, 2025 12:51
Copy link
Collaborator

@murisi murisi left a comment

Choose a reason for hiding this comment

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

Thanks for clarifying the context of this code. I see nothing obviously wrong or improvable with the changes to the MASP VP or the transfer context. I just wonder if we could utilize existing code and execution paths more in order to minimize risk. For instance, the transfer context has code to update the note commitment tree and the undated balances though apply_shielded_transfer does something similar. In the MASP VP, the new logic skips the anchor check execution paths when the ProtocolIbcShielding condition is met.

I guess I just wonder if there could be a single function to create a dummy transaction based off (owner_pa, token, amount, ...) (potentially having correct anchors) that can be:

  • constructed (from the event) and used by clients to update their shielded state
  • constructed and used by the transfer context to update undated balances and note commitment tree (somehow using the apply_shielded_transfer function)
  • constructed by the MASP VP (from the event) and fed into the existing verification logic in a way that minimizes the number of checks that are disabled/the number of paths through the verification logic.

A unified dummy transaction logic would ensure that IBC transactions are synchronized, executed, and verified in the exactly same way. Overall the code is likely correct, but it would be nice to leverage existing mainnet code as much as possible to minimize risk of unexpected behaviour. Of course, this hypothetical approach might not be practical!

@sug0 sug0 mentioned this pull request Nov 12, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:api public API breaking change breaking:consensus Consensus breaking change that requires a hard-fork breaking-change IBC MASP UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blind IBC to znam MASP depositing (memoless) Shielded refund design

7 participants