-
Notifications
You must be signed in to change notification settings - Fork 317
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
Additional data encode/decode methods #1667
Comments
This is needed to enable filecoin-project/lotus#10316 |
Noting this is for normal sectors, not snapdeals |
ELI5: Lotus wants an API for encoding/decoding of "normal" (i.e. non CC) sectors.
|
Apparently this is quite easy to do in Go, approximate code that may work: import (
"github.com/consensys/gnark-crypto/ecc/bls12-381/fr"
)
func encode(keyBytes []byte, valueBytes []byte) fr.Element {
// Convert bytes to field elements
key := new(fr.Element).SetBytes(keyBytes[:])
value := new(fr.Element).SetBytes(valueBytes[:])
// Add the field elements
key.Add(key, value)
return *key
} We should probably test that + a snapdeals variant before adding rust-side APIs which may turn out to be redundant |
SnapDeals decode is merged and available through the FFI via filecoin-project/filecoin-ffi#402. Normal replica encode/decode will be implemented directly in Go. |
Currently methods for encoding/decoding data to/from sectors are quite limited.
The text was updated successfully, but these errors were encountered: