Token: privateToPublic + changePartialNote #10286
Labels
C-aztec.nr
Component: Aztec smart contract framework
S-needs-discussion
Status: Still needs more discussion before work can start.
team-fairies
Nico's team
#10153 showcased a new token interaction pattern: transferring tokens from private into a contract that later returns some change in public, requiring a partial note. The contract needs to wait until public execution because during private it lacks some of the information required (e.g. current balances for the AMM, or gas used for an FPC).
The desired behavior is achieved by making two calls:
This is subpar because each call is relatively expensive, not just due to arg packing etc but also because of the extra kernel iteration. We should consider implementing a variant of
transfer
that also returns a partial note, which would reduce the gate count significantly, at the expense of a larger API surface. An alternative would be to add a paramater to transfer which indicates whether to produce a partial note, but this would increase the gate count of regular transfers, which is likely undesirable.The text was updated successfully, but these errors were encountered: