WalletPress — Python backend (FastAPI) + WordPress plugin. Wallet engine, x402 service, chain vault, hosting. CLI for wallet management. Production-grade wallet-as-a-service.
Find a file
Rug Munch Media LLC d3f95e67c9
fix(wallet_engine): WP-055 Cardano via pycardano
Add Cardano (ADA) address generation using the official pycardano
library which implements IOHK's Kholaw (BIP32-Ed25519) derivation
correctly. Hand-rolled Kholaw implementations tend to get subtle
details wrong (HMAC ordering, scalar addition mod L, network byte
values), so we delegate to pycardano.

Verified against:
- pycardano's own Address() output (matches byte-for-byte)
- The official `cardano-address` CLI from IOHK (v4.0.6) — verified
  that the spending_key_hash matches exactly:
    payment: 9b206f67cc03a2f3cb97988759878715eb387a9eeff9247fedbeb2b8
    stake:   45dd8424772e4a23936f6dd23d3e459d8f036a84825dedeff8d26cbc

Implementation:
- chain_addresses.py: cardano_address, cardano_enterprise_address,
  cardano_reward_address (all via pycardano)
- generator.py: ada added to CHAIN_ADDRESS_OVERRIDES with curve
  'ed25519_kholaw'. The raw 32-byte ed25519 signing key is extracted
  from xsk[:32] and returned as private_key_hex. Public key derived
  via nacl.crypto_sign_seed_keypair.
- _generate_mnemonic() now always returns str() (was sometimes
  Bip39Mnemonic object, which pycardano rejects).
- Added test_cardano_matches_pycardano, test_cardano_testnet,
  test_cardano_enterprise_matches_pycardano.

Cardano address types supported:
- Base (addr1... mainnet, addr_test1... testnet) — payment + stake
- Enterprise (addr1v... mainnet) — payment only
- Reward / stake (stake1... mainnet) — stake only

Derivation per CIP-1852:
- payment key: m/1852'/1815'/0'/0/0
- stake key:   m/1852'/1815'/0'/2/0

pycardano's actual disk footprint is only 1.1 MB + 9 MB of small deps
(asn1crypto, certvalidator, oscrypto, etc. — most are < 2 MB each).
That's well within budget for a wallet product that needs correct
Cardano addresses.

Test results:
  pytest tests/test_address_vectors.py
  # 22 passed (was 19)
  pytest tests/
  # 80 passed, 5 skipped, no regressions

Refs: ADDRESS_GENERATION.md, BUILDER.md
Closes: WP-055
2026-06-30 20:06:55 +07:00
backend fix(wallet_engine): WP-055 Cardano via pycardano 2026-06-30 20:06:55 +07:00
cli feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
installers feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
wp-plugin feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
.gitignore feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
.pre-commit-config.yaml feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
about.html Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
ADDRESS_GENERATION.md fix(wallet_engine): WP-055 Cardano via pycardano 2026-06-30 20:06:55 +07:00
ARCHITECTURE.md docs(walletpress): full audit + canonical documentation framework 2026-06-30 18:48:16 +07:00
AUDIT.md fix(wallet_engine): WP-040..WP-058 — fix 18 broken address generators 2026-06-30 19:30:29 +07:00
BUILDER.md fix(wallet_engine): WP-055 Cardano via pycardano 2026-06-30 20:06:55 +07:00
buy.html Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
contact.html Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
CONTRIBUTING.md feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
docs.html feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
features.html Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
index.html Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
logo.svg Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
privacy.html feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
PROGRESS.md feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
ROADMAP.md feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
ROADMAP_V2.md feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
robots.txt feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
SECURITY.md docs(walletpress): full audit + canonical documentation framework 2026-06-30 18:48:16 +07:00
sitemap.xml feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
STRATEGY.md feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
terms.html feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
thanks.html Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
verify.html feat: backend, installers, legal pages, pre-commit, docs — v1.0.0-beta follow-up 2026-06-29 17:21:45 +07:00
walletpress-docs.pdf Initial commit: WalletPress v1.0.0-beta 2026-06-27 17:12:49 +07:00
WALLETPRESS.md docs(walletpress): full audit + canonical documentation framework 2026-06-30 18:48:16 +07:00