-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat(Keys_Nullifier): nullify an escrowed note #5864
Comments
Note that there is another edge case - "open bets"/open oracles where I want to enter into a bet or want someone to fulfill my request at a price but I do not know who that specific person will be - it is open to the public to see who wants to challenge me or fulfill my request. |
Beyond the issues of figuring out who should be nullifiying, it might also be quite strange on who should be the "sender" of It gets especially weird if the contract always assumes that someone is emitting outgoing. Say that I send funds to Rahul, who don't have an outgoing specified, or it might be a contract that don't or whatever. The if it is a requirement that the outgoing is emitted it would not be possible to transfer from these accounts. Essentially making stuff like the "sent funds to contract, are they lost" worse as there could be functions to "rescue" funds, but that they are not possible to get out because the out was never specified - only some funds can be rescued then. |
You could just use a "known key" for that. Meaning that anyone know the information to nullify, but the logic of the application must be satisfied first. The current best model I can really think of is to have the extra function, which can be used to specify the A danger would be that if used to send funds to wallets etc, it would seem to them as they have notes that might increase their balances or the like, but then not actually being able to spend them (as mentioned earlier). The spend-ability is defined by the individual contract, but assuming not too many oddities in most of the tokens it should be covered by being able to compute the nullifier which is also currently done as part of the unconstrained A benefit is that the model doesn't really need anything new from Aztec.nr for the nullification. For the other kinds of keys, we might again run into some "oddities", which I will briefly discuss here for some kind of completeness:
|
While people disliked my naming, the below should describe with enough flexibility to support the escrowing. The implementation will be easier if waiting for #5630 to be addressed, as it is then mostly changing a few input values, and reusing some of the logical changes in there. |
Will be closing this along with #6632. |
Many notes include an
owner
who is the provider of nullification secrets. In most of the implementations, this is the same entity that the logic of the contract sees as the owner.Example, for the
token
this is commenly the note and how it is used:Where the key in the
balances
map is is the same as theowner
of the notes in the that it is mapping to.As have been discussed at other occaisions, one way to escrow a note, is to use the logic to guard the
owner
and then change the provider of secrets to a different address.Let us do a bit of renaming because
owner
andowner
not being the same make my 👀 bleed.In most usual cases, we would have that
owner
is the actor that knows thenullifier_master_secret_key
for thenullifier_master_public_key
and we just have logic similar to today.In cases of escrowing, you could specify the
owner
as the escrow contract, but thenullifier_master_public_key
as another. Which to chose would depend on the duration. For a "transient escrow" the ownership could simply be the actor sending the funds.Example 1:
You use some contract to aggregate actions, so you transfer funds into it where it is not the
owner
but your key is still thenullifier_master_public_key
for the note. In this case, you can provide the secrets, but the logic of theowner
contract specifies how they are spent.Example 2:
For some betting escrow, the
nullifier_master_public_key
could be a shared key between the betting participants, allowing any of them to create the nullifiers and the notes are then constrained only by the logic of theowner
escrow contract.Issue!
While this sounds all good and dandy for transfers that are complex. We need to provide additional inputs to the function. This could be done as having a separate function that is used for just handling this kind of escrowing where the key is also inputted - or by using an oracle.
An issue with the oracle is that other contracts cannot easily constrain what you are feeding in there (Would need to have you prove the membership and that the real key is in there, a lot of annoying logic on top of a
transferFrom
->safeTransferFrom
incoming).E.g., for the examples above, I could use the oracle to always just feed in my own address even if I am sending funds to someone else or depositing into a contract.
If doing this, it behave similarly to having sent funds, but they will not be spendable by the recipient.
When dealing only with person-to-person transfers that is like never sending, and people would look angry at you and not give you what you paid for.
When dealing with contracts that handle funds it gets worse. As you at the time of execution could seem genuine and if not checked sufficiently the funds looks like they are in the "balance" of the recipient, but they cannot be spent, so if it gives you are receipt token you practically have that the receipt is unbacked.
This could lead to you exiting with other peoples funds and them not being able to exit at the end even though the funds are there if they are not spendable.
Is the funds really yours if you cannot spend them?
The freedom brings a new issue - unless it is provided as an argument, how do you know the correct "nullifier_master_public_key`.
Note that the diagram is talking about secrets as well, but I see this as the same in practice on how it influences the usage as needing something passed in that somehow must be constrained.

The text was updated successfully, but these errors were encountered: