Skip to content

Conversation

@ciaranightingale
Copy link
Contributor

Add docs explaining in more detail:

  • Note delivery
  • Note discovery
  • Note tagging
  • Handshakes (?) and alt patterns

@ciaranightingale ciaranightingale marked this pull request as draft January 20, 2026 15:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive documentation explaining note delivery mechanisms, note discovery, and tagging in Aztec smart contracts. The documentation helps developers understand how to deliver notes to recipients and the tradeoffs between different delivery modes.

Changes:

  • Added detailed documentation for note delivery modes (OFFCHAIN, ONCHAIN_UNCONSTRAINED, ONCHAIN_CONSTRAINED)
  • Expanded note discovery documentation with solutions for handling unknown senders
  • Added clarification about the "sender" in note tagging being the account contract, not the transaction sender

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
docs/aztec-nr/framework-description/note_delivery.md New comprehensive guide explaining note delivery modes, discovery mechanisms, and code examples
docs/foundational-topics/advanced/storage/note_discovery.md Enhanced with detailed explanations of sender roles, limitations, and handshaking solutions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +185 to +186
// Admin is the owner of the note and is motivated to receive it
// Use unconstrained delivery since we don't know if deployer is incentivized
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The comment states 'Use unconstrained delivery' but the code uses ONCHAIN_CONSTRAINED. Either the comment should be updated to explain why constrained delivery is used, or the code should be changed to match the comment.

Suggested change
// Admin is the owner of the note and is motivated to receive it
// Use unconstrained delivery since we don't know if deployer is incentivized
// Admin is the owner of the note and is motivated to receive it,
// but the deployer might not be. Use constrained delivery to ensure the
// admin's note is included onchain even if the deployer is uncooperative.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

agree with copilot

Comment on lines +185 to +186
// Admin is the owner of the note and is motivated to receive it
// Use unconstrained delivery since we don't know if deployer is incentivized
Copy link
Contributor

Choose a reason for hiding this comment

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

agree with copilot


#### The sender in note tagging

The "sender" in note tagging is **not necessarily the transaction sender**. It's the **sender for tags**, which account contracts set by calling `set_sender_for_tags(account_address)` before making calls to other contracts. This is typically the account contract address itself.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious if you are aware of any cases where the tag sender is not the users account contract?


**Example use cases:**
- Change notes when transferring tokens (you're sending to yourself)
- Payments where the recipient won't provide goods/services without the note
Copy link
Contributor

Choose a reason for hiding this comment

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

can you elaborate on why this is a good example? It's not clear to me why offchain is the right use for this case


### `MessageDelivery.OFFCHAIN`

**Fully offchain delivery with no guarantees.**
Copy link
Contributor

Choose a reason for hiding this comment

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

wdyt about saying more about what this method actually does? namely, the message is encrypted, without constraints and emitted via an oracle call, but i think thats it? Is it then accessible to the PXE and can be exported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that right?? Is it emitted by an oracle call? @nventuro can you explain this please - im a bit confused

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