Member-only story

Programmatic Spacemesh Wallet Generation

TickTockBent
3 min readJun 28, 2024

--

Spacemesh, a blockchain protocol built on a novel proof-of-space-time consensus mechanism, requires a unique approach to wallet generation. This article outlines the methodology of creating Spacemesh wallet addresses programmatically. While I’ve provided Python implementations for each step of the process, the methods are easily adaptable to other languages.

Requirements

Before we begin, you’ll need to have Python 3.7+ installed, and have the cryptography, blake3 and bech32 libraries. These libraries will handle our cryptographic operations, hashing, and address encoding respectively.

pip install cryptography blake3 bech32

The Anatomy of a Spacemesh Address

A Spacemesh address isn’t just a random string of characters. It’s a carefully constructed identifier that encapsulates several layers of cryptographic operations. Let’s break down what you need to make a spacemesh address.

1. The Foundation

To start, you will need a ED25519 key pair. ED25519 is a public-key signature scheme of EdDSA. Here’s a simple example, but you should customize this to your application. This code snippet creates a new key pair and extracts the public key in its raw byte form. In a real world application you’d probably want to save the keys somewhere safe but here we’re only concerned about generating them.

from…

--

--

TickTockBent
TickTockBent

Written by TickTockBent

I write a few unofficial articles to help understand Spacemesh but I am not affiliated with the team in any way.

No responses yet