FilOzone / pdp

Smart contracts and utilities for Proof of Data Possession
Other
2 stars 2 forks source link

Offchain utils -- Storage proof generator #3

Closed ZenGround0 closed 1 month ago

ZenGround0 commented 3 months ago

Write a go program that given a file and an index into the file returns a valid merkle proof of that index to the root of the file. There's some ambiguity in the interface here. Maybe we take in challenge seed and a set of files corresponding to a proof set? Maybe that's somewhere else and we just take in the file. Maybe we also take in merkle root of file and check against it?

We'll want this for integration testing on devnets and potentially for generating proofs for use in solidity tests.

anorth commented 2 months ago

This is both a Go library that we might expect SP software to integrate, and a binary wrapping it for use, especially in testing.

anorth commented 2 months ago

don't think existing Go merkle tree libraries are going to be any good for us here. They all require something analogous to [][]byte as input for the leaves. We want to use a single []byte (or really a random-access file) with the breaking into leaves being implicit. We don't want to instantiate slices.

For reference, some existing Go merkle tree libs:

ZenGround0 commented 1 month ago

I think this is now covered by 1) all @anorth's testing work i.e. here 2) curio soon beginning work on the actual node which will include proof generation.

We can reopen this if we decide we want to do something in addition to the curio pdp node.