Skip to content

Decide appropriate hash function(s) for NMT internal / blob hashes #11

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

Closed
rphmeier opened this issue Nov 14, 2023 · 6 comments
Closed

Comments

@rphmeier
Copy link
Contributor

Either choose one or a couple hash functions for extra blobs

Consider using a different hash function for blobs vs NMT nodes

Multiple hash functions = multiple trees + extra overheads per blob in the multi-core model

@rphmeier rphmeier added this to the Sugondat Monocore Kusama milestone Nov 14, 2023
@rphmeier
Copy link
Contributor Author

Related to #8 and #9 .

sha2 is currently used as it's optimized in RISC0 but other hash functions may be better with other proving systems.

Celestia uses sha2
Avail uses ?

@pepyakin
Copy link
Contributor

avail uses blake2-256 it seems.

@pepyakin
Copy link
Contributor

Rollkit doesn't use inclusion proofs. It solely relies on the connected DA node. It's not clear atm how they are going to implement bridging.

I was not able to find any mention of inclusion proofs in OP-Stack, although I did not look extremely thoroughly. It sounds in line with the folklore that OP doesn't have fraud proofs. I thought I would have more luck with looking at ethereum-optimism/optimism@develop...celestiaorg:optimism:celestia-develop (last commit is 6ce4e61713b6d588f23f06c08af874f78c13a570) so that I would see the integration of sha256 based proofs of celestia, but no, there are no membership proofs used either.

I donno. I feel like given that celestia and avail uses sha256, it's already a good place to start.

@rphmeier
Copy link
Contributor Author

rphmeier commented Dec 1, 2023

avail uses blake2-256 it seems.
and avail uses sha256

merge conflict

I wonder how much more efficient sha256 is in risc0 vs blake2-256. couldn't blake2 also be optimized?

@pepyakin
Copy link
Contributor

pepyakin commented Dec 1, 2023

I wonder how much more efficient sha256 is in risc0 vs blake2-256.

https://risc0.github.io/ghpages/dev/benchmarks/index.html

couldn't blake2 also be optimized?

I don't have a good insight, but it feels like it should be. Totally depends on the will of risc0 though.

@pepyakin
Copy link
Contributor

pepyakin commented Dec 4, 2023

Today on the sync call we decided to go with sha256 for now. Specifically, we may launch on kusama with the sha256 NMT trie. However, we will probably reserve the right to break the compatibility with official launch on polkadot.

@pepyakin pepyakin closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants