Improving l1 to l2 messaging API #52
benesjan
started this conversation in
AZIP Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
In Oxide we don't really use the secret hash when depositing to L2 — it's set to a constant value everywhere. That's because we want the message to contain a recipient. So instead we have a
recipient_hashcomputed offchain as:This
recipient_hashis then part of the message content preimage.Nice properties
recipientin the message is the same thing as the note owner — it's no longer only the secret that "owns" the message.The problem
This has a very bad property for Oxide: with a constant secret, anyone can see when a recipient spends the message (broken nullifier unlinkability).
Possible solutions
Solution 1 — Drop the secret hash altogether.
Expect the contract calling
Inboxto handle it, then provide standardized deposit and claim utils in both Solidity and Aztec.nr.Solution 2 — Replace
secret_hashwithsalted_recipient_hash.Do this in the
Inboxcontract and everywhere else, then modifycompute_l1_to_l2_message_nullifierto use the recipient'snhkinstead of the secret.My take
I think Solution 1 is better: with the utils we get basically equivalent devex without enshrining a specific derivation scheme in the L1 contracts.
The reason why we have not done it as I propose in the first place is because the API is just very old (it's from a time when we didn't even have a proper
Aztec.nr). Now the API is overfitted and pushes devs towards bad security model of "secret" owning a message.Then if devs try to do it properly and have the recipient in the content then if they use the constant secret approach we have in oxide they are likely to shoot themselves in the food as the standard
process_l1_to_l2_messagefunctionality of Aztec.nr expects real secret on the input for the message nullifier to not be linkable.Opinions?
Beta Was this translation helpful? Give feedback.
All reactions