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

specification: file organization in protocol spec #4485

Merged
merged 13 commits into from
Jun 3, 2024
Merged

Conversation

TalDerei
Copy link
Collaborator

@TalDerei TalDerei commented May 26, 2024

Describe your changes

Several parts of the protocol are not specified, while being referred to in other parts of the documentation. We should remove these empty patches in our protocol spec, and use this PR as a guiding reference of what sections were removed as we periodically fill them in over time. @conorsch can you help better format the docs?

This references components X and Y in the ECC audit log. Auxiliary to this is component Z, which should probably be (but currently is not) captured here since they're also spec-related changes.

This also captures supplemental spec changes based on specific spec-related comments made in the audit.

Issue ticket number and link

Checklist before requesting a review

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

@TalDerei TalDerei added the ecc-component-remediated Tag PRs that are remediating ecc findings label May 26, 2024
@TalDerei TalDerei changed the title specification: clean up file organization in protocol spec specification: file organization in protocol spec May 26, 2024
@@ -5,6 +5,6 @@ Plaintext notes contain:
* the value to be transmitted which consists of an integer amount $v$ along with a scalar (32 bytes) $ID$ identifying the asset.
* $rseed$, a 32-byte random value, which will later be used to derive the note blinding factor used for the
note commitment and an ephemeral secret key.
* the destination address, described in more detail in the [Addresses](../addresses_keys/addresses.md) section.
* the destination address controlling the note, described in more detail in the [Addresses](../addresses_keys/addresses.md) section.
Copy link
Collaborator Author

@TalDerei TalDerei May 26, 2024

Choose a reason for hiding this comment

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

In the note plaintext section of the audit, there was some confusion about pk_d. Comparing the spec against the code reveals some incongruences:

  • the Address struct defines pk_d as the public key used for the payment address, but the spec defines pk_d
    as the diversified transmission key.
  • the Note struct consists of value, rseed, address, and transmission_key but the spec is missing the diversified transmission key.

@@ -1,3 +1,17 @@
# Note Ciphertexts
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note encryption was previously unspecified.

@@ -8,6 +8,14 @@ attaches a *detection key* to each address, allowing a user to outsource
probabilistic transaction detection to a relatively untrusted third-party
scanning service.

## Privacy Implications
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added privacy implications associated with detection keys based on comments made in component Y.

@@ -14,7 +14,7 @@ The note commitment is generated using rate-5 Poseidon hashing with domain separ
The note commitment is then constructed using the above domain separator and
hashing together the above contents along with the note blinding factor $rcm$:

`note_commitment = hash_5(ds, (rcm, v, ID, B_d, pk_d))`
`note_commitment = hash_6(ds, (rcm, v, ID, B_d, pk_d, ck_d))`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -17,7 +17,6 @@
- [Group Hash](./crypto/decaf377/group_hash.md)
- [Test Vectors](./crypto/decaf377/test_vectors.md)
- [Randomizable Signatures](./crypto/decaf377-rdsa.md)
- [Key Agreement](./crypto/decaf377-ka.md)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we should actually keep this section and link to the implementation

@cratelyn cratelyn added this to the Sprint 7 milestone May 28, 2024
@TalDerei
Copy link
Collaborator Author

@redshiftzero this doesn't have an associated issue attached to it

@cratelyn cratelyn added the A-docs Area: Documentation needs for the project label May 29, 2024
@TalDerei TalDerei marked this pull request as ready for review May 31, 2024 09:25
@TalDerei
Copy link
Collaborator Author

TalDerei commented May 31, 2024

this is a staging area for spec-related changes, and we'll focus on addressing the rest of the spec changes once phase 2 is unblocked.

@@ -1 +0,0 @@
# CommunityPoolDeposit
Copy link
Member

Choose a reason for hiding this comment

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

The audit (correctly) pointed out that we lack complete documentation of the protocol, and have these stub pages in the protocol spec. We should remove pages that are no longer relevant, but I think in every case the stub pages are relevant, i.e. the CommunityPoolDeposit does exist as an action, and as such should be ideally documented in the protocol specification. So I think the action here is to fill these pages out (not in this PR because that's a significant chunk of work) instead of deleting them. One thing we could do is just make a list of pages that should be filled out in an issue.

Copy link
Collaborator Author

@TalDerei TalDerei May 31, 2024

Choose a reason for hiding this comment

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

sounds great, will revert the deleted pages and open a relevant PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

references #4516

Copy link
Member

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

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

LGTM! I'm going to merge this and we can add smaller spec changes in followups

@redshiftzero redshiftzero merged commit c0ddd37 into main Jun 3, 2024
13 checks passed
@redshiftzero redshiftzero deleted the cleanup-spec branch June 3, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation needs for the project ecc-component-remediated Tag PRs that are remediating ecc findings
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants