Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Bech32 Grin Relay Address

Gary Yu edited this page Aug 25, 2019 · 3 revisions

Inspired by BIP-0173 base32 address, we also use base32 address for Grin Relay.

Comparing to Base58 address, this base32 / Bech32 address has the following benefits:

Address Scheme --> Bech32 / Base32 Base58
QR Codes ☑ Better Needs a lot of spaces
write/read/type ☑ Better Needs more care about the mixed case
Error-Detection ☑ Yes No
Decoding Complexity ☑ Faster Slower

HRP (Human Readable Part)

We define two HRP prefixes for Grin Relay address:

  • gn: for Grin Mainnet address
  • tn: for Grin Floonet (Testnet) address

Address Length

We use 33 bytes Public Key as the Grin Relay address identification, after this base32 coding, it occupy 59 characters.

For example, here are some Floonet addresses:

  • tn1-qgun5fxd-npn72kdz3myetqa-tgkxg7th5y0ymcn-jcsf0n8nzzv8tc5-q9uhkp
  • tn1-qgfaqdqy-vm8ryd2k6zfp6cm-359cs4gnudxhljm-d0v38yut4u9r7rg-93d4jp
  • tn1-qvgsq0kd-7gvgqksg58fkqm9-ms5cplcllev4fnw-svevuqs2jukrtrc-guuvze

- Splitter

To make this address string more readable, we use 5 minus sign (-) to split the address string into 6 parts:

  • The 1st part is the tn1 or gn1.
  • The 2nd part is the 1st 8 elements from the whole 59 elements.
  • The 3rd/4th/5th part each is the coming 15 elements.
  • The last part is the last 6 elements, which is the checksum.

The idea to use splitter is for some advanced feature of this Bech32 address, which will be discussed in the future.