You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some Mirror Node APIs do not accept the default serialisation format for the public key, and this conversion needs to be performed first
In some circumstances, one needs to have a valid account ID, prior to the account being initialised on the network, for example in order to receive an initial transfer
Context: HIP-32 defines the a long form account ID like so:
This long form doesn’t look like 0.0.123, but instead is an alias consisting of <shard>.<realm>.<bytes>, where the bytes is a base32url representation of the bytes of a serialized HAPI primitive Key, with the trailing = padding characters removed. For example, 0.0.CIQNOWUYAGBLCCVX2VF75U6JMQDTUDXBOLZ5VJRDEWXQEGTI64DVCGQ is the alias address of shard 0 realm 0 with a serialization of a HAPI Key for the ed25519 public key 0xd75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a.
Solution
What
Consider adding utility methods in EntityIdHelper class or the PublicKey class
One method to convert from Ed25519 public key to long account ID, for example:
Problem
Why
Context: HIP-32 defines the a long form account ID like so:
Solution
What
EntityIdHelper
class or thePublicKey
classd75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a
CIQNOWUYAGBLCCVX2VF75U6JMQDTUDXBOLZ5VJRDEWXQEGTI64DVCGQ
CIQNOWUYAGBLCCVX2VF75U6JMQDTUDXBOLZ5VJRDEWXQEGTI64DVCGQ
d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a
base32url
Alternatives
Further considerations
References
base32url
The text was updated successfully, but these errors were encountered: