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?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
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: