WalletPress — Python backend (FastAPI) + WordPress plugin. Wallet engine, x402 service, chain vault, hosting. CLI for wallet management. Production-grade wallet-as-a-service.
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
|
||
|---|---|---|
| backend | ||
| cli | ||
| installers | ||
| wp-plugin | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| about.html | ||
| ADDRESS_GENERATION.md | ||
| ARCHITECTURE.md | ||
| AUDIT.md | ||
| BUILDER.md | ||
| buy.html | ||
| contact.html | ||
| CONTRIBUTING.md | ||
| docs.html | ||
| features.html | ||
| index.html | ||
| logo.svg | ||
| privacy.html | ||
| PROGRESS.md | ||
| ROADMAP.md | ||
| ROADMAP_V2.md | ||
| robots.txt | ||
| SECURITY.md | ||
| sitemap.xml | ||
| STRATEGY.md | ||
| terms.html | ||
| thanks.html | ||
| verify.html | ||
| walletpress-docs.pdf | ||
| WALLETPRESS.md | ||