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

Describe note discovery note tags #713

Merged
merged 6 commits into from
May 30, 2024

Conversation

Dominik1999
Copy link
Collaborator

Closes #440

I describe how Note Tags are used to discover relevant notes.

@Dominik1999 Dominik1999 force-pushed the dominik_describe_note_discovery_note_tags branch from 198479e to f077324 Compare May 29, 2024 17:38
| `0b10` | Local | Any | NoteType::Public |
| `0b11` | Local | Any | Any |

- Execution hint: Set to `Network` for network transactions. These notes will be validated and, if possible, consumed in a network transaction.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Execution hint: Set to `Network` for network transactions. These notes will be validated and, if possible, consumed in a network transaction.
- Execution hint: Set to `Network` for network transactions. These notes are validated and, if possible, consumed in a network transaction.

@@ -196,10 +195,32 @@ hash(hash(hash(hash(serial_num, [0; 4]), script_hash), input_hash), vault_hash)
!!! info
To compute a note's hash, we do not need to know the note's `serial_num`. Knowing the hash of the `serial_num` (as well as `script_hash`, `input_hash` and `note_vault`) is also sufficient. We compute the hash of `serial_num` as `hash(serial_num, [0; 4])` to simplify processing within the VM._

## Note discovery
## Note discovery (note tags)
Copy link
Contributor

@bobbinth bobbinth May 30, 2024

Choose a reason for hiding this comment

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

I think one thing missing from this section is a concrete example of how note tag can be used by one user to make a note discoverable by another user. I think after reading this, people may still not fully understand how tags can be used and an example could drive it home. We could use a P2ID note tag scheme to explain this.

In general, I think we can make this section much more detailed (the content here could be easily 3x - 4x of what is here now) and it could maybe even be its own separate sub-section. But maybe that's for another 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.

Jup, I also have the feeling that the entire note chapter is too long already. I will add the example for now and we should do a bigger refactor for the chapter and add several sub-sections.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In general, I think, what is missing to make those really great docs:

  • the ppl who write / design the code should also write the section (they know exactly why a certain design was chosen)
  • Miden cannot be used at the moment, but the docs should describe how to use Miden. It will get better, once there is the compiler. Then we can describe how to use a note tag using a specific example.

@Dominik1999 Dominik1999 force-pushed the dominik_describe_note_discovery_note_tags branch 2 times, most recently from c91cd8d to 547bb0d Compare May 30, 2024 09:02
@Dominik1999 Dominik1999 force-pushed the dominik_describe_note_discovery_note_tags branch from 547bb0d to 1654062 Compare May 30, 2024 09:02
@Dominik1999 Dominik1999 merged commit 69a21c0 into next May 30, 2024
7 of 9 checks passed
@Dominik1999 Dominik1999 deleted the dominik_describe_note_discovery_note_tags branch May 30, 2024 09:11
bobbinth pushed a commit that referenced this pull request Jul 4, 2024
* docs: adding note tags to note discovery

* changing it slightly

* after review

* after another review

* adding a P2ID example

* adding a P2ID example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants