7

If I have only the seed to an account, how can I find the public key?

12

Java Script

let StellarSdk = require("stellar-sdk");
let keypair = StellarSdk.Keypair.fromSecret("S...");
console.log(keypair.publicKey());

http://stellar.github.io/js-stellar-sdk/Keypair.html#.fromSecret

Go

kp, err := keypair.Parse("S...")
if err != nil {
    fmr.Println("Error", err)
} else {
    fmt.Println(kp.Address())
}

https://godoc.org/github.com/stellar/go/keypair#Parse

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.