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

Clarity: Add intrinsic for SHA512/256 #1107

Closed
jcnelson opened this issue Sep 5, 2019 · 0 comments

Comments

@jcnelson
Copy link
Member

commented Sep 5, 2019

Blockstack uses the SHA512/256 hash function to (among other things) authenticate state in the MARF. If we want smart contracts to be able to do this automatically, then at the very least we need to support an intrinsic function for calculating the SHA512/256 hash of a buffer.

The immediate use-case that comes to mind is in app chains. This intrinsic would pave the way for allowing an app chain user to "re-integrate" some of the app chain state into a new smart contract on the Stacks chain by supplying the block header for a previously-accepted proof-of-burn block hash, and then supplying the key/value pair and a MARF Merkle proof for it. A smart contract code library could be written that would only insert state into a data map if the caller could (1) supply a block header for an on-chain block commit, (2) supply the key/value pair, and (3) supply the MARF Merkle proof that demonstrates that this state came from this app chain block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.