Replies: 1 comment
|
The recommended canonical textual form of an endpoint ID is generally lowercase hex-encoding, but think of it similar to the canonical encoding of sha2sum/sha3sum, b3sum or whateversum is hex as well. base32 encoding exists for backwards compatibility reasons: We switched from base32 to hex in the past. z32 encoding exists for use with Pkarr, which uses z32, but that's supposed to be only used for z32. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have a question about the recommended string encoding for
EndpointIdsThe context is radicle-artifact which augments radicle with signed content-addressed artifact distribution. From a technical perspective, radicle-artifact is modelled as a CRDT whose actions are stored as JSON in git storage. Given this, I want to strike the right balance between efficiency, interoperability, and pragmatism.
From
iroh-base/src/key.rs,EndpointIdis just a type alias forPublicKey, and the current string behaviour seems a bit mixed:Display for PublicKeyrenders as lowercase hexFromStr for PublicKeyaccepts {hex, but also accepts base32 viadecode_base32_hexto_z32()/from_z32()helpers for z-base-32That left me unsure what the recommended canonical textual form of an endpoint ID is supposed to be.
A few specific questions:
Assuming string based storage, i.e. JSON, the base32/z-base-32 are clearly more efficient than hex, but it's not clear which is recommended between the two. Assuming DNS based discovery, I suppose there's convenience to be gained from being able to use pkarr tooling but I'm not familiar with all the trade-offs here.
Is hex considered the canonical/default representation, with base32 formats supported only as parsing conveniences? (this comment from @dignifiedquire seems to support this, though it's not clear what the referenced drawbacks of different alphabets, like base3, are)
Thanks
All reactions