Skip to content

Make TokenWithRefunds Production-Ready #7319

@just-mitch

Description

@just-mitch

Partial notes were used to make private refunds possible.

In short, private refunds allow Alice to fund an arbitrary transaction (possibly with public functions) using an arbitrary private token via a fee payment contract, and get her refund as private token notes.

Without this flow, Alice must fund her transactions either:

  • natively with AZT herself
  • using public balances and an FPC
  • using private balances but forgoing a refund

Partial notes generally support patterns where we need to construct a note that is dependent on on-chain data sources that are not available in private.

Example sources are:

  • price feeds
  • prevailing interest rates
  • weather data from IoT sensors
  • time

Applications could include:

  • start a point $(\text{owner} + \text{principle})*G$, complete it with the prevailing interest rate to construct a note representing a loan.
  • submit a claim on your farm insurance based on regional flooding data.
  • private discounts/deals based on time of day
  • lock some private assets as a point, cash them out privately with interest based on the amount of time they were locked up.
  • a dex where the liquidity is in public but rewards/swaps occur with notes

So the use cases are compelling, but there are problems with the current implementation. This issue tracks work to make the concept ready for production.

### Tasks
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7325
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7323
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7320
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7321
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7322
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7324
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7326
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7650
- [ ] https://github.com/AztecProtocol/aztec-packages/issues/7688

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions