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

ZIP 231: Memo Bundles #824

Merged
merged 11 commits into from
Nov 6, 2024
Merged

ZIP 231: Memo Bundles #824

merged 11 commits into from
Nov 6, 2024

Conversation

str4d
Copy link
Collaborator

@str4d str4d commented Apr 26, 2024

Part of #627.

@str4d
Copy link
Collaborator Author

str4d commented May 2, 2024

EDIT: Moved comments to #627 (comment) (to keep discussion in the issue, not the PR).

@nuttycom
Copy link
Contributor

nuttycom commented May 2, 2024

EDIT: Moved comments to #627 (comment)

@str4d
Copy link
Collaborator Author

str4d commented Jul 16, 2024

Rebased on main to pull in the repo reorg.

@nuttycom nuttycom changed the title ZIP 231: Initial draft ZIP 231: Memo Bundles Oct 9, 2024
zips/zip-0231.md Outdated Show resolved Hide resolved
zips/zip-0231.md Outdated Show resolved Hide resolved
zips/zip-0231.md Show resolved Hide resolved
zips/zip-0231.md Outdated Show resolved Hide resolved
@str4d
Copy link
Collaborator Author

str4d commented Oct 9, 2024

Comments above were from today's R&D meeting (I intended to leave them collectively as a review, but forgot to click the right GitHub buttons).

zips/zip-0231.md Outdated Show resolved Hide resolved
Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

Flushing comments.

zips/zip-0231.md Outdated Show resolved Hide resolved
zips/zip-0231.md Outdated Show resolved Hide resolved
zips/zip-0231.md Outdated Show resolved Hide resolved
zips/zip-0231.md Outdated Show resolved Hide resolved
zips/zip-0231.md Outdated Show resolved Hide resolved
zips/zip-0231.md Outdated

The symmetric encryption key for a memo is derived from its `memo_key` as follows:

encryption_key = PRF^{expand}_{memo_key}([0xE0] || nonce)
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify where else the 0xEO constant needs to be documented.

zips/zip-0231.md Outdated
Comment on lines 166 to 167
TODO: Decide whether to permit an optimised encoding for a fully-pruned memo
bundle that just contains `memo_bundle_digest`.
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we wrote the pruned value prior to the nonce, and then just used 0xFFFFFFFFFFFFFFFF for the "fully pruned" indicator? Then, the nonce and nMemo* would only be present if the pruned value is not equal to that value.

This could also help with indistinguishability: instead of omitting the memo bundle entirely, all "no memo" transactions could instead represent themselves as fully pruned; the recipient would be able to distinguish between "my memo has been pruned" and "there is no memo" by inspecting the flag byte in their output.

Copy link
Contributor

Choose a reason for hiding this comment

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

In thinking about and discussing pruning with @str4d and @arya2, several concerns arose related to pruning.

  • If pruning is permitted in the network protocol format, what does the behavior of nodes need to be when they receive a pruned transaction? Do they continue attempting to retrieve the full transaction data from other peers? If so, does this create a potential situation where nodes have to keep track of which peers they've re-requested transactions from when attempting to restore complete memo data? How long do nodes need to continue retrying in order to ensure that they have obtained all the memo data that is available?
  • Does pruning introduce a risk to the usability of memos on the network, due to a tragedy of the commons where node operators prefer to prune memos to save on storage and bandwidth, and as a consequence data availability suffers?
  • Is there a potential adversarial case to consider, where some party cheaply runs a bunch of nodes on the network, all of which prune memo data when propagating transactions, thereby directly attacking data availability?

It's my personal opinion that the risks and complexity introduced by the pruning functionality make it infeasible to implement pruning in NU7. It might be something that can be introduced at a later date, but given the other functionality that we're currently aiming to support in NU7, we should attempt to avoid any changes that impact the network protocol if at all possible.

@nuttycom nuttycom added NU7 proposal consensus Consensus changes, and errors or omissions in consensus specification labels Nov 1, 2024
zips/zip-0231.md Outdated
the sender addresses (to give the recipient a guarantee that the address is
controlled by a sender of the transaction). These Authenticated Reply Addresses
require zero-knowledge proofs, and for the Orchard protocol these proofs are too
large to fit into a 512-byte memo field.
Copy link
Contributor

@nuttycom nuttycom Nov 1, 2024

Choose a reason for hiding this comment

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

Another use case we should be concerned with here is coin voting - can the proofs in Hanh's coin voting protocol (along with the amount being voted with) fit into a memo? I think extended memos can provide an ideal mechanism for election organizers to collect the secret ballots.

Comment on lines +172 to +328
memo_chunk_digest = H(AEAD(MemoChunk, memo_key))
memo_bundle_digest = H(concat(memo_chunk_digests))
Copy link
Contributor

Choose a reason for hiding this comment

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

This is intended to commit only to the effecting data, and to exclude any pruning metadata.

@nuttycom nuttycom added the F-transaction-v6 Feature: v6 transactions label Nov 5, 2024
zips/zip-0231.md Show resolved Hide resolved
@zcash zcash deleted a comment from nuttycom Nov 6, 2024
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Copy link
Collaborator

@daira daira left a comment

Choose a reason for hiding this comment

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

ACK

Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

ACK

@str4d str4d merged commit 8df78c6 into main Nov 6, 2024
@str4d str4d deleted the zip-231 branch November 6, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus Consensus changes, and errors or omissions in consensus specification F-transaction-v6 Feature: v6 transactions NU7 proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants