Substrate Wallet Guide

Understanding Substrate Wallets and Address Conventions

Substrate is a blockchain development framework created by Parity Technologies that allows developers to build custom blockchains. It’s the foundation upon which Polkadot and many other blockchains are built. Substrate provides a modular architecture where developers can choose and customize various components, including the account and address system.

Substrate just happens to be the framework that the Subspace Protocol and therefore the Autonomys Network is built on.

TL;DR

The Autonomys Network uses the SS58 address format. That means that a single seed phrase deriving an account can be represented in a number for formats. For example, this seed phrase:

burden elite evidence shiver unit spring churn primary brush fuel indoor magnet

Gives us a default Substrate address of: 5DRdk5tocyroWWast4A5APtpV1xabrCb5GQ1G84TZUtTW3HE

Which looks like this on Gemini (custom prefix 2254): st7d7pacGKeK2G8ZTkDoZNaNtDdM3YYgr6XsjYg2kMQDZLERq

And looks like this on Taurus (custom prefix 6094): sucS1hTjK61Rvc1dRLCzv36NFuuVTNJ8eveBhmvgGJE8sZDpf

But all represent the same account.

Note that the farmer software accepts the --reward-address in either st or su format with the rewards being sent to the single account both formats represent.

If you want to know more about how this works, please read on!

What is an SS58 Address Format?

SS58 is a modified version of Base58-Check encoding specifically designed for Substrate-based chains. Key characteristics include:

  • It’s derived from Bitcoin’s Base58-Check encoding but with important modifications
  • Addresses always begin with a network-specific prefix
  • Uses blake2b-512 hashing instead of double-SHA256 for checksum calculation
  • Includes built-in type recognition through the prefix system

The basic structure of an SS58 address is:

prefix (1-2 bytes) | payload (public key) | checksum (2-8 bytes)

Why can a Substrate Account be Represented in Different Formats?

A Substrate account can be represented in multiple formats because the underlying public key remains constant while the encoding format changes. The same account can be represented as:

  1. Raw Public Key (32 bytes)

    • The fundamental representation
    • Usually displayed as a hexadecimal string
    • Example: 0x3c328a2597eac1a22dbb9ef23baf4477c91dc5c119d0d0b6fd4a7cf8f6506c06
  2. SS58 Address

    • Network-specific encoded format
    • Human-readable and includes error detection
    • Example: 5DRdk5tocyroWWast4A5APtpV1xabrCb5GQ1G84TZUtTW3HE
  3. Generic Substrate Address

    • Uses the default Substrate prefix (42)
    • Compatible with any Substrate-based chain

The ability to represent accounts in different formats serves several purposes:

  • Network identification
  • Error detection
  • Cross-chain compatibility
  • Human readability

What is an SS58 Custom Prefix?

An SS58 custom prefix is a unique identifier assigned to different Substrate-based networks. It serves several important purposes:

  1. Network Identification

    • Each network has a unique prefix
    • Helps prevent cross-chain transaction errors
    • Common prefixes:
      • 0: Polkadot
      • 2: Kusama
      • 42: Generic Substrate
      • Custom ranges available for other networks
  2. Prefix Ranges:

    • 0-1: Polkadot Live
    • 2-16: Kusama and early adopters
    • 17-41: Reserved for future use
    • 42: Generic Substrate address
    • 43-999: Reserved for future protocols
    • 1000+: Custom application-specific addresses
  3. Security Benefits:

    • Prevents accidental cross-chain transfers
    • Enables visual identification of target network
    • Maintains network-specific address formats

Example of the Same Account on Different Networks:

Polkadot:  12MvtR9sUm8Gx3bPqhD5JYiyLdxEJ9kj9m8VRR3p7ZuygPHC
Kusama:    DwFQQEgFLsjGAQKeky84MFpdcEpQX1mXeEkenLR3H6xF9PH
Generic:   5DRdk5tocyroWWast4A5APtpV1xabrCb5GQ1G84TZUtTW3HE

All these addresses represent the same underlying public key but are formatted differently based on their network prefix.

The tool at ss58.org allows you to play with this behaviour to get comfortable with it.

3 Likes