chatch / stellar-hd-wallet

🔐 Key derivation for Stellar (SEP-0005) 🚀
https://www.npmjs.com/package/stellar-hd-wallet
Apache License 2.0
84 stars 48 forks source link

Steller account does not address hex #6

Closed vlasfama closed 6 years ago

vlasfama commented 6 years ago

I was checking "stellar-hd-wallet" ,It generate only secret Key and public key, I cant find the address hex. Does the public keys is receive address.?

Akuukis commented 6 years ago

In Stellar address is not written as hex, but base32. Also public key is the receiving address, unless you do magic with signers yourself.

vlasfama commented 6 years ago

Thanks, Is it possible to derive the address from the public key..?

Akuukis commented 6 years ago

Public key is the receiving address, copy/paste ready.

When you create a new keypair (secret & public key) in Stellar, your public key is also your keypair's address. Once you fund it with required deposit, you have an active account. In very basic case "keypair", "address" and "account" are the same thing, or rather different angles of the same thing.

Once you change your accounts signers so that original keypairs secret is not a signer for it anymore, then obviously that account's address is not the receiving address of your secret anymore. As you can see, once things get interesting it's useful to have 3 different terms to describe what exactly is going on.