Closed gg718 closed 11 months ago
You must initialize the BLS system before using it.
package main
import (
"fmt"
"github.com/wealdtech/go-ed25519hd"
e2types "github.com/wealdtech/go-eth2-types/v2"
util "github.com/wealdtech/go-eth2-util"
)
func main() {
mnemonic := "olympic salt stereo force iron tornado pilot inhale mandate banner play review auto tape lion absorb print nature element timber float identify world satoshi"
seed, err := ed25519hd.SeedFromMnemonic(mnemonic, "")
if err != nil {
panic(err)
}
if err := e2types.InitBLS(); err != nil {
panic(err)
}
sk, err := util.PrivateKeyFromSeedAndPath(seed, "m/12381/3600/0/0/0")
if err != nil {
panic(err)
}
fmt.Printf("%x\n", sk.Marshal())
}
My bad. All good now, thanks a lot!
I can't figure out why the following is panicking.
I generated a throwaway mnemonic for this example:
Output:
But the key in the error message seems valid, so I'm not sure what the issue is?