aztec-packages icon indicating copy to clipboard operation
aztec-packages copied to clipboard

feat(AuthWit): Allow generating authwits on the fly

Open spalladino opened this issue 1 year ago • 3 comments

In complex executions it's difficult for the app to foresee the exact authwit requests that need to be added to the pxe before simulating execution. It's particularly difficult if the authwit request includes a random element.

Until we implement something like https://github.com/AztecProtocol/aztec-packages/issues/9133, it may be useful to allow devs to sign authwits on the fly as they are requested to the pxe's oracle.

Note that this may be difficult to implement today, since the pxe today sits behind a json rpc interface, and has no way to call back into the client. In an actual production setup, the pxe would be integrated into the wallet software, and it'd be the wallet that implements this hook and not aztec.js.

Requested by Wonderland

spalladino avatar Dec 19 '23 19:12 spalladino

We can introduce a oracle that makes a call out, requesting for a structured message (#5075) to be signed by the PXE. For testing, could be possible to just have the PXE blindly sign what it is asked, but for user execution it could make a call to the user's wallet, allowing them to sign the request or deny it and make the transaction fail.

Should help on our issue of currently requiring clairvoyant code.

LHerskind avatar Mar 08 '24 10:03 LHerskind

Since we have more pressing matters and this is mainly a nice to have, I'm unassigning myself from this task.

LHerskind avatar Apr 22 '24 09:04 LHerskind

but for user execution it could make a call to the user's wallet, allowing them to sign the request or deny it and make the transaction fail.

The big issue here is how do we reach back to the wallet, since it is the wallet that has called into PXE via json-rpc. Is the wallet e.g. listening at some endpoint for singing requests?

nventuro avatar Oct 11 '24 10:10 nventuro

We've determined that https://github.com/AztecProtocol/aztec-packages/issues/9133 is the way to go for these.

nventuro avatar Jun 02 '25 18:06 nventuro