NoteStream icon indicating copy to clipboard operation
NoteStream copied to clipboard

Make stream creation and sending of ZkAsset atomic

Open TomAFrench opened this issue 5 years ago • 2 comments

Currently to create a stream requires 2 transactions (1 through sdk to send the ZkAsset to the contract, 1 to give the stream parameters). This leads to the possible situation of the second transaction failing which locks the note on the contract unless the user manually generates the second transaction again.

Once the proof generated by the aztec sdk's ZkAsset.send method is able to be exported, we should combine these two transaction calls to prevent locked funds.

TomAFrench avatar Apr 05 '20 00:04 TomAFrench

This is hard requirement before launching on mainnet as currently it's trivial for a malicious party to drain a stream in their favour by submitting a new stream creation transaction for the same notehash.

TomAFrench avatar Apr 07 '20 14:04 TomAFrench

Seems like AZTEC have silently added the proof export option

http://docs.aztecprotocol.com/#/SDK/zkAsset/Main%20APIs/.send

All that remains is generating the required signature

TomAFrench avatar Apr 09 '20 11:04 TomAFrench