Home > OS >  Is there a one to one correlation between pub/priv key pairs and account IDs on the Hedera Network?
Is there a one to one correlation between pub/priv key pairs and account IDs on the Hedera Network?

Time:10-01

One public key usually corresponds to one or a specific number of addresses in other cryptocurrencies based on some algorithm.

https://testnet.dragonglass.me/hedera/transactions/0025330611632361982325526043 https://testnet.dragonglass.me/hedera/transactions/0025330611632362160372571164 In hedera, as the above two transactions have shown, using the same public key to send out two accountCreate transactions gives back two different accountId.

Is there an API whose params are a public key and who returns all the account Ids corresponding to the public key?

CodePudding user response:

The mirror nodes support querying based on public key. However, Hedera's accounts are not 1:1 with a public key, you can't assume a public key is linked to a single account, in fact, the same public key can be used across multiple accounts meaning the same private key can sign transactions for all these accounts.

Furthermore, an account can be associated to a list of public keys meaning every key has to sign, or a threshold list which is a list where say 5 of 10 have to sign. All these can be nested too !

Finally, subject to having the private key to sign the transaction, you can update an account's public key. What you can't do is derive the account id from the public key. The account id comes from a sequence of numbers, each new entity (an account is an entity as are topics, tokens, etc...) is given the next id in the sequence.

  • Related