Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Clarity: Add intrinsic for SHA512/256 #1107
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.