3

There doesnt seem to be an API call that returns the public key for my NXT account (with which I have not sent out any coins yet).

The NXT wallet does display the public key after I log in, but how do I calculate this public key programmatically?

5

There is now a getAccountPublicKey API request. But as you indicated, the public key is shown prominently in the NXT reference client (NRS version 1.3.2 currently) when an account is first opened with a secret passphrase.

This public key can be used along with the account ID (which is derived from the public key) to fund the new account from another account, thus securing the new account by adding the public key to the blockchain. If a different secret passphrase were then to be used which results in the same account ID (such a collision being a distinct possibility), it could not open the account since its corresponding public key would be different from the one already stored in the blockchain.

The public key will no longer be displayed prominently in the NXT client, but it still can be viewed by sending a transaction, then clicking on the timestamp of the transaction as displayed in the client, then clicking on "Transaction Details". The first field in the pop-up window is "Sender Public Key".

If you are interested in the algorithm for computing the public key from the secret passphrase, refering to the Whitepaper:Nxt:

  1. The secret passphrase is hashed with SHA256 to derive the account's private key.
  2. The private key is encrypted with Curve25519 to derive the account's public key.

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.