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

Whats the data format (or is it compatible) for "bmt multihash 0xd6 Binary Merkle Tree Hash" to hash binary forest pairs that define a function that returns byte[] id of another object (id of an id generator then its id)? #153

Open
benrayfield opened this issue Dec 23, 2019 · 3 comments

Comments

@benrayfield
Copy link

benrayfield commented Dec 23, 2019

How would I give the context in the id to say what its hashing?

Something like... QmmultihashId...sdfsdf:bmt:occamsfuncerV1:contextSpecificId4234234 but that seems too many names in an id and theres binary form.

It is only a forest of pairs and leaf is all 0s (undecided on how many 0s), of calls of a universal lambda function which would for example derive a preprocessing of small literal bitstrings to quote them else use a securehash and may have bit masks etc... Since I dont want to deal with the never ending complexity of updating software when new stuff is added, I just want to use multihash to (less efficiently) name every possible binary forest (that generates a function) and let the functions do the rest, further optimizing, etc.

@Stebalien
Copy link
Member

I believe bmt here refers to bmt-sha3. However, I'm not sure if there are any working implementations of this at the moment.

cc @acud? Should we rename this to bmt-sha3?

@benrayfield
Copy link
Author

benrayfield commented Jan 5, 2020

Theres already a data format for a merkle pointer. The multiformats header then whichever possible suffix that type allows. If theres no implementations of it, why not define the content to be hashed as a pair of multiformats objects?

Also I have use for a trinary forest. Maybe there should be a type for a list of n (varint) multiformats objects.
Are you sure theres no implementations? I read somewhere that ethereum uses a sha3 binary merkle forest but I'm not sure what else they put into the hash or what the leafs are.

@Stebalien
Copy link
Member

If theres no implementations of it, why not define the content to be hashed as a pair of multiformats objects?
Are you sure theres no implementations? I read somewhere that ethereum uses a sha3 binary merkle forest but I'm not sure what else they put into the hash or what the leafs are.

The goal was to support an ETH2 use-case. I believe it was the sha3 binary merkle tree you're talking about. IIRC, they're hashing a pure binary tree where each node is exactly two hashes and the leaves are always 32 bytes (or 64 bytes?). They wanted to use this format to better support zero-knowledge proofs (e.g., zkSNARKs) over subsets of the hashed data.

Also I have use for a trinary forest. Maybe there should be a type for a list of n (varint) multiformats objects.

We'd usually just assign a new codec per variant. What does the internal structure of your tree look like?

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

3 participants
@Stebalien @benrayfield and others