Understanding Pubkey vs Address in Duniter v1 and v2

I wanted to clarify the difference between pubkey and address in Duniter v1 and v2, as it can be a source of confusion for developers moving between versions or building apps like Cesium².


Duniter v1 (Ğ1)

  • The “address” is essentially the public key itself, encoded in Base58.

  • No network prefix, no checksum, no distinction between pubkey and address.

  • Example:

v1 pubkey / address (Base58):
DCovzCEnQm9GUWe6mr8u42JR1JAuoj3HbQUGdCkfTzSr

  • Here, pubkey = address, so any reference to the address is actually the public key.

Duniter v2 (Substrate-based)

  • Accounts are represented using SS58 addresses.

  • SS58 = network prefix + pubkey + checksum.

  • Pubkey and address are not the same.

  • Example: the same pubkey from v1 becomes an SS58 address:

v1 pubkey:
DCovzCEnQm9GUWe6mr8u42JR1JAuoj3HbQUGdCkfTzSr

v2 address (SS58):
g1AT6CJW8yVKwUuQc7sM5Kk9GZVTpbZYk9PfjNXtvnNgAJZ1

  • This encoding allows multiple crypto algorithms (ed25519, sr25519, ecdsa) and network prefixes (e.g., gdev, gtest).

Key Implications

  1. In v1, tools can safely treat pubkey and address as identical.

  2. In v2, you must distinguish:

    • pubkey: raw cryptographic key

    • address (SS58): encoded identifier for display and network use

  3. Some addresses may exist without a corresponding pubkey in v2, breaking assumptions from v1.


For developers migrating apps or building APIs, it’s crucial to know which identifier your system expects. Treating pubkey and address interchangeably in v2 will likely cause errors.


Here’s how Cesium² is showing both:

Cheers,
Kapis


3 Likes

Hello :slight_smile:
Small remark for the first image, you mention Network prefix 42 if gdev (which is indeed the default Substrate prefix) but show the SS58 Address for the “g1” network prefix instead (network prefix value for that one is 4450 I believe)

3 Likes

Corrigé, Merci!!

1 Like