Skip to content

Electrum Wallet for Bitmark - Staged Implementation #139

@melvincarvalho

Description

@melvincarvalho

Summary

Create a lightweight Electrum-style wallet for Bitmark, implemented in stages to allow incremental development and testing.

Motivation

Currently Bitmark users must run a full node to manage their funds. An Electrum-style wallet would provide:

  • Lightweight client (no full blockchain download)
  • Fast synchronization
  • Hardware wallet support (future)
  • Cross-platform desktop application

Technical Approach

Base Fork

  • Electrum 3.3.x - Proven base used by Electrum-LTC, Electron Cash
  • Python-based, well-documented, active maintenance

Bitmark Network Parameters

# Mainnet
ADDRTYPE_P2PKH = 0x55        # 85 - addresses start with 'b'
ADDRTYPE_P2SH = 0x05         # 5
WIF_PREFIX = 0xD5            # 213
GENESIS_HASH = "c1fb746e87e89ae75bdec2ef0639a1f6786744639ce3d0ece1dcf979b79137cb"
DEFAULT_PORT = 9265
RPC_PORT = 9266

# BIP32 Extended Keys
XPUB_HEADER = 0x0488B21E
XPRV_HEADER = 0x0488ADE4

Key Files to Modify

File Purpose
electrum/constants.py Network params, genesis, prefixes
electrum/network.py Server connection handling
electrum/util.py Config directory (.electrum-bitmark)
setup.py Package metadata

Staged Implementation

Stage 1: Proof of Concept (RPC Backend)

Goal: Working wallet connected directly to bitmarkd RPC

  • Fork Electrum 3.3.x
  • Update constants.py with Bitmark parameters
  • Replace ElectrumX client with bitmarkd RPC adapter
  • Basic functionality: generate addresses, check balance, send BTM
  • Test on mainnet with small amounts

Deliverable: Desktop wallet requiring local bitmarkd node

Stage 2: ElectrumX Integration

Goal: Proper Electrum protocol with dedicated server

  • Fork ElectrumX and add Bitmark coin support
  • Handle multi-algorithm PoW block headers (or trust daemon)
  • Address indexing and history
  • Switch wallet from RPC to ElectrumX protocol
  • Local server testing

Deliverable: Self-hosted ElectrumX + compatible wallet

Stage 3: Production Infrastructure

Goal: Public servers for end users

  • Deploy 2-3 geographically distributed ElectrumX servers
  • SSL certificates and hardened configuration
  • Hardcode public server list in wallet
  • Release builds (Windows, macOS, Linux)
  • User documentation

Deliverable: Production-ready lightweight wallet

Reference Implementations

Considerations

Multi-Algorithm PoW

Bitmark supports 8 PoW algorithms. For Stage 1 (RPC), this is handled by bitmarkd. For Stage 2+, ElectrumX needs to either:

  • Implement header validation for all algorithms, OR
  • Trust the connected bitmarkd for validation

No SegWit

Bitmark does not support SegWit, simplifying the implementation (no bech32 addresses needed).

Repository Structure

Propose creating new repos under project-bitmark:

  • electrum-bitmark - Wallet client
  • electrumx-bitmark - Server (Stage 2+)

Labels: enhancement, wallet, infrastructure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions