Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Murisi/masp test vectors rebased #2427

Merged
merged 7 commits into from
Jan 26, 2024
Merged

Conversation

murisi
Copy link
Collaborator

@murisi murisi commented Jan 23, 2024

Describe your changes

Implemented the random generation of MASP test vectors and slightly altered MASP-related transaction sections to facilitate the printing of shielded amounts with correct denominations. More specifically, the changes are as follows:

  • Used proptest to generate random shielding, shielded, and deshielding MASP transactions
  • Implemented a MASP TxProver to aid constructing these transactions with the following properties:
    • It is faster than LocalTxProver since it does not generate any zero-knowledge proofs
    • It is more correct than MockTxProver since it generates binding signatures that the hardware wallet will check
  • Improved the formatting of MASP transactions by using the new denomination information
  • Modified the AssetType derivation to be parameterized by a token's token::Denomination
    • Needed for hardware wallets to safely display and sign shielded denominated amounts
    • Modified the MaspTxBuilder supplied to hardware wallets to include token::Denomination in the preimages

Indicate on which release or other PRs this topic is based on

Namada v0.30.1

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@murisi murisi marked this pull request as ready for review January 23, 2024 13:03
@murisi murisi force-pushed the murisi/masp-test-vectors-rebased branch from b1b8004 to 6bd7968 Compare January 23, 2024 13:16
@murisi murisi mentioned this pull request Jan 23, 2024
@murisi murisi requested a review from grarco January 23, 2024 13:55
@murisi murisi force-pushed the murisi/masp-test-vectors-rebased branch from 6bd7968 to 3a3cd92 Compare January 23, 2024 14:25
tzemanovic added a commit that referenced this pull request Jan 23, 2024
* origin/murisi/masp-test-vectors-rebased:
  Added changelog entry.
  Reified the pre-image of AssetTypes.
  Hashed the token denomination into AssetTypes to tighten HW wallet signing.
  Constrained the range of MASP test vectors generated for correctness.
  Now generating binding test vectors binding signatures correctly.
  Increased usage of prop_oneof macro.
  Now generating arbitrary ShieldedTransfer.
Copy link
Collaborator

@grarco grarco left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

@tzemanovic tzemanovic mentioned this pull request Jan 24, 2024
tzemanovic added a commit that referenced this pull request Jan 25, 2024
* origin/murisi/masp-test-vectors-rebased:
  Added changelog entry.
  Reified the pre-image of AssetTypes.
  Hashed the token denomination into AssetTypes to tighten HW wallet signing.
  Constrained the range of MASP test vectors generated for correctness.
  Now generating binding test vectors binding signatures correctly.
  Increased usage of prop_oneof macro.
  Now generating arbitrary ShieldedTransfer.
@tzemanovic tzemanovic mentioned this pull request Jan 25, 2024
@tzemanovic tzemanovic merged commit 51eb113 into main Jan 26, 2024
14 of 15 checks passed
@tzemanovic tzemanovic deleted the murisi/masp-test-vectors-rebased branch January 26, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants