# On What basis Zcash keys are encoded in?

**URL:** <https://forum.zcashcommunity.com/t/on-what-basis-zcash-keys-are-encoded-in/39224>\
**Category:** zcashd client\
**Created:** [May 7, 2021, 10:25am UTC](https://forum.zcashcommunity.com/t/on-what-basis-zcash-keys-are-encoded-in/39224 "2021-05-07T10:25:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabgami977](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/saurabgami977/32/18064_2.png) [@Saurabgami977](https://forum.zcashcommunity.com/u/Saurabgami977)\
**Post date:** [May 7, 2021, 10:25am UTC](https://forum.zcashcommunity.com/t/on-what-basis-zcash-keys-are-encoded-in/39224/1 "2021-05-07T10:25:07Z")

</div>

// guarantees the first 2 characters, when base58 encoded, are “t1” keyConstants.base58Prefixes[PUBKEY\_ADDRESS] = {0x1C,0xB8};

How is t1 =\> {0x1C, 0xB8} ?  
How are these converted?

How can I do these converts for other prefixes?  
suppose: Pp, Ll, pk, PL

---

<div class="post-metadata">

**Author:** ![daira](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/daira/32/43253_2.png) [@daira](https://forum.zcashcommunity.com/u/daira)\
**Post date:** [May 7, 2021, 6:53pm UTC](https://forum.zcashcommunity.com/t/on-what-basis-zcash-keys-are-encoded-in/39224/2 "2021-05-07T18:53:01Z")

</div>

This is specific to Base58. I would strongly recommend that for new protocols (e.g. new Zcash forks or shielded protocols) that [bech32](https://zips.z.cash/zip-0173) or [bech32m](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki) be used, rather than Base58. Those allow the prefix or “Human-Readable Part” to be specified directly.

That said, the above prefix was found as follows: append the correct number of bytes for an address to the candidate prefix, first using 0x00 bytes and then using 0xFF bytes, and encode the result as Base58. If both of those encodings start with the desired string, then the prefix is correct. (Knowledge of the order of the Base58 character set can be used to speed up the search, but it still involves some trial and error.) Note that this only works if the length of an address is fixed, as it is for Zcash transparent and Sprout addresses.

---

<div class="post-metadata">

**Author:** ![hanh](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/hanh/32/27853_2.png) [@hanh](https://forum.zcashcommunity.com/u/hanh)\
**Post date:** [May 8, 2021, 5:23am UTC](https://forum.zcashcommunity.com/t/on-what-basis-zcash-keys-are-encoded-in/39224/3 "2021-05-08T05:23:13Z")

</div>

> [@Saurabgami977](#):
>
> How can I do these converts for other prefixes?  
> suppose: Pp, Ll, pk, PL

You won’t be able to have Ll because lowercase L is not part of the base 58 alphabet.
