-
Notifications
You must be signed in to change notification settings - Fork 275
Address Standard (Bech32)
This post is meant to be an informative post detailing the address standard adopted by the Zilliqa blockchain. This document provides the concise details of the bech32 address format customised for the Zilliqa protocol.
Due to EIP-55 being not widely adopted by wallets and exchanges, the 20-bytes base16 checksum variation used by Zilliqa protocol to prevent the loss of funds sent to an Ethereum address is not viable.
Hence, Zilliqa shall adopt a variation of the bech32 format on the wallets/SDKs level in order to prevent Users from sending ERC20 ZIL tokens from their Ethereum wallets (i.e. MyCrypto/MyEtherWallet) to a native ZIL address and vice versa.
Please note that the native protocol will still utilise the 20-bytes base16 checksum on the backend. This is a cosmetic change of the 20-bytes base16 checksum address to bech32 format on the wallets/SDKs level only. It will only be visible to end-users.
All examples below use the public key 039fbf7df13d0b6798fa16a79daabb97d4424062d2f8bd4e9a7c7851e732a25e1d:
- Mainnet legacy
base16checksummed address:0x7Aa7eA9f4534d8D70224b9c2FB165242F321F12b - Mainnet
bech32checksummed address:zil102n74869xnvdwq3yh8p0k9jjgtejruft268tg8 - Testnet
bech32checksummed address:zil102n74869xnvdwq3yh8p0k9jjgtejruft268tg8
Please refer to bip-0173 for more details of the bech32 technical specification.
A Zilliqa bech32 checksummed address consists of the following aspects:
| Human-readable prefix | separator |
bech32 formatted address |
checksum | |
|---|---|---|---|---|
| Example 1 | zil |
1 |
02n74869xnvdwq3yh8p0k9jjgtejruft |
268tg8 |
| Example 2 | zil |
1 |
48fy8yjxn6jf5w36kqc7x73qd3ufuu24 |
a4u8t9 |
| Example 3 | zil |
1 |
fdv7u7rll9epgcqv9xxh9lhwq427nsql |
58qcs9 |
- Do note that the human-readable prefix for Zilliqa mainnet is
zil, and the human-readable prefix for Zilliqa Developer testnet is alsozil. - Do also note that the last six characters of the data part form a checksum and contain no information.
In order to support both bech32 (DEFAULT) and legacy base16 (OPTIONAL) address formats, we recommend to refer to the code snippet below in order to perform a sanity check with the utility tools provided by our official zilliqa-js SDK:
private normaliseAddress(address: string) {
if (validation.isBech32(address)) {
return fromBech32Address(address);
}
if (isValidChecksumAddress(address)) {
return address;
}
throw new Error('Address format is invalid');
}-
Reference encoder and decoder in within different languages SDKs:
- For JavaScript
- For Java
- For Python
- More languages support to come...
-
Online utility tool to convert
base16checksummed addresses tobech32format:
The lists below will be updated over time as adoption of bech32 checksummed format increases:
| Wallet | Support bech32 checksummed addresses |
Support legacy base16 checksummed address |
|---|---|---|
| Moonlet | ✔️ | ✔️ |
| ZilPay | ✔️ | ✔️ |
| Zillet | ✔️ | ✔️ |
| Trust Wallet | ✔️ | - |
| Math Wallet | ✔️ | - |
| ZHIP | ✔️ | |
| xZIL | ✔️ | - |
| Exchanges | Support bech32 checksummed addresses |
Support legacy base16 checksummed address |
|---|---|---|
| Binance | ✔️ | - |
| Kucoin | ✔️ | - |
| Upbit | ✔️ | - |
| Coinhako | ✔️ | ✔️ |
| Coinone | ✔️ | - |
| Huobi | ✔️ | - |
| OKEx | ✔️ | - |
| Gate.io | ✔️ | - |
| CoinEx | ✔️ | - |
Viewblock explorer will be supporting both the new bech32 and legacy base16 checksummed in the search bar in order to ease the transition to bech32 checksummed addresses for all Users. A tooltip will also be available for Users to convert between the two address formats temporarily.