Hi, @stakach , let me describe my demand, please give me some clue if this is possible when use with openssl_ext shards.
- The first step, i generate some mnemonics, like this: [“measure”, “come”, “cube”, “ostrich”, “wide”, “inspire”, “hello”, “essay”, “ready”, “cute”, “reform”, “sustain”], use can writ e it somewhere, which can be used to restore a hex string like this:
m1 = Bip0039::Mnemonic.new ["measure", "come", "cube", "ostrich", "wide", "inspire", "hello", "essay", "ready", "cute", "reform", "sustain"]
# => <Bip0039::Mnemonic:0x7f37ca6e4c80 @ent=128, @seed=183297182565288719506055787609377395053>
m1.to_hex
# => "89e5c0d5ce7faaea9ab269b2c6d6d16d"
I use bip39 shard for this, it works.
- Then i need use above hex string,
89e5c0d5ce7faaea9ab269b2c6d6d16d, or the array of mnemonics, to generate a pair of key, i am blocked on there.
When use go, those code like this:
import (
"bytes"
"crypto/ecdsa"
"crypto/elliptic"
"github.com/tyler-smith/go-bip39"
)
seed, err := bip39.NewSeedWithErrorChecking(mnemonic, "password")
if err != nil {
return
}
return ecdsa.GenerateKey(elliptic.P256(), bytes.NewBuffer(seed))
Thank you.