You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently use bitcoin's double SHA256, but there's no point in doing that.
we have a lot of options to choose from:
Single SHA256
SHA512-256
SHA3-256
Blake2b-256
Blake2s-256
and more.
Things we should consider:
Interoperability.
CPU performance.
Friendliness to binary/arithmetic circuts and R1CS (STARK/SNARK).
For interoperability, the only modern hash function bitcoin supports is SHA256.
Ethereum supports SHA256 and SHA3-256, and there's a proposal for Blake2b.
ZCash uses Blake2b for most things, but blake2s for some other specific things (not sure why), source
For performance we can see the difference between them in the official Go implementations:
For SNARK/STARK friendliness, it's hard to know and requires more research but after talking with some people it seems that:
For PLONK Blake2s is around ~2.5K gates per round, SHA256 and blake2b is around ~5K per round, and keccak/SHA3 is ~12K per round.
We should also think if we care that Schnorr(BIP-340) and ECMH use SHA256 internally
The text was updated successfully, but these errors were encountered:
We currently use bitcoin's double SHA256, but there's no point in doing that.
we have a lot of options to choose from:
Single SHA256
SHA512-256
SHA3-256
Blake2b-256
Blake2s-256
and more.
Things we should consider:
For interoperability, the only modern hash function bitcoin supports is SHA256.
Ethereum supports SHA256 and SHA3-256, and there's a proposal for Blake2b.
ZCash uses Blake2b for most things, but blake2s for some other specific things (not sure why), source
For performance we can see the difference between them in the official Go implementations:
For SNARK/STARK friendliness, it's hard to know and requires more research but after talking with some people it seems that:
For PLONK Blake2s is around ~2.5K gates per round, SHA256 and blake2b is around ~5K per round, and keccak/SHA3 is ~12K per round.
We should also think if we care that Schnorr(BIP-340) and ECMH use SHA256 internally
The text was updated successfully, but these errors were encountered: