You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I use this library to create an identity with derivation path m/44'/223'/0'/0/0 like in BitfinityWallet?
I should get oap7l-lib6g-7bly6-ksdy3-kv45y-tld53-tbvfg-en7y3-rtzab-4qzlb-sqe, not rsqft-yxgsv-3mlzx-xbhsd-jkqnq-oyl3i-bmo67-g2whv-u6jxy-2vgo3-aae
package main
import (
"fmt"
"log"
"github.com/aviate-labs/agent-go/identity"
"github.com/aviate-labs/secp256k1"
"github.com/tyler-smith/go-bip39"
)
func main() {
seedPhrase := "final advice catch admit matter garage lottery hotel roof frown object able cart draw illegal" // test seed
// Generate seed from seed phrase
seed, err := bip39.NewSeedWithErrorChecking(seedPhrase, "")
if err != nil {
log.Fatalf("Error generating seed: %v", err)
}
// Generate secp256k1 private key from seed
secp256k1PrivateKey, _ := secp256k1.PrivKeyFromBytes(secp256k1.S256(), seed[:32])
// Create secp256k1 identity
secp256k1Identity, err := identity.NewSecp256k1Identity(secp256k1PrivateKey)
if err != nil {
log.Fatalf("Error creating Secp256k1 identity: %v", err)
}
// Get principal for Secp256k1
secp256k1Principal := secp256k1Identity.Sender()
// Output Secp256k1 principal
fmt.Println("Secp256k1 Principal:", secp256k1Principal) // Must be oap7l-lib6g-7bly6-ksdy3-kv45y-tld53-tbvfg-en7y3-rtzab-4qzlb-sqe, not rsqft-yxgsv-3mlzx-xbhsd-jkqnq-oyl3i-bmo67-g2whv-u6jxy-2vgo3-aae
}
The text was updated successfully, but these errors were encountered:
How can I use this library to create an identity with derivation path
m/44'/223'/0'/0/0
like in BitfinityWallet?I should get oap7l-lib6g-7bly6-ksdy3-kv45y-tld53-tbvfg-en7y3-rtzab-4qzlb-sqe, not rsqft-yxgsv-3mlzx-xbhsd-jkqnq-oyl3i-bmo67-g2whv-u6jxy-2vgo3-aae
package main
The text was updated successfully, but these errors were encountered: