Skip to content
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

Make stream creation and sending of ZkAsset atomic #25

Open
TomAFrench opened this issue Apr 5, 2020 · 2 comments · May be fixed by #43
Open

Make stream creation and sending of ZkAsset atomic #25

TomAFrench opened this issue Apr 5, 2020 · 2 comments · May be fixed by #43
Labels
bug Something isn't working contracts enhancement New feature or request future Long term goals react-app

Comments

@TomAFrench
Copy link
Owner

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 TomAFrench added enhancement New feature or request react-app contracts future Long term goals labels Apr 5, 2020
@TomAFrench TomAFrench changed the title Make stream creation and sending of note atomic Make stream creation and sending of ZkAsset atomic Apr 5, 2020
@TomAFrench TomAFrench added the bug Something isn't working label Apr 7, 2020
@TomAFrench
Copy link
Owner Author

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
Copy link
Owner Author

TomAFrench commented Apr 9, 2020

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 TomAFrench linked a pull request Apr 9, 2020 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contracts enhancement New feature or request future Long term goals react-app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant