rob thijssen 0b1cfe35b3 feat(quantus-crypto): derive wormhole addresses
A wormhole address is not a key. A path under coin type 189189189 yields a
32-byte secret, and the address is poseidon(poseidon(salt || secret)). Funds
leave only through a ZK proof of that secret. The extension needs the
addresses to show a wallet's wormhole account; it has no use for the secrets.

wormholeAddresses(mnemonic, password, account, branch, start, count) returns
32-byte account ids for m/44'/189189189'/<account>'/<branch>'/<index>', the
mobile wallet's paths. The secrets and first hashes are derived and wiped
inside WASM.

The BIP39 seed is stretched once per call rather than once per address, since
a gap-limit window is dozens of addresses and each stretch is 2048 PBKDF2
rounds. A call is capped at 1000 addresses, and indices must stay below 2^31.

Pinned to the chain node's own vector
(node/src/tests/data/quantus_key_test_data.rs): TEST_MNEMONIC at
m/44'/189189189'/0'/0'/0' is TEST_WORMHOLE_ADDRESS, the same pair the mobile
wallet's SDK tests. Checked in Rust and through the packed package's consumer
test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012uDUodEcRbBwNRi3UCmw8f
2026-09-16 15:58:13 +03:00
2025-08-13 13:59:40 -03:00
2025-01-02 21:26:31 +02:00
2020-10-23 11:14:40 +02:00
2019-03-17 13:12:14 +01:00
2022-01-13 10:05:36 +02:00
2019-03-17 13:12:14 +01:00
2021-06-08 17:04:07 +02:00
2026-03-13 01:32:10 +02:00
2025-01-02 21:26:31 +02:00
2025-12-09 15:27:27 +05:30
2019-03-15 13:00:05 +01:00
2025-12-09 10:03:06 +00:00
2026-03-13 01:32:10 +02:00
2022-08-16 15:04:17 +03:00
2019-03-17 13:12:14 +01:00
2022-12-08 08:21:37 +02:00
2026-03-13 01:32:10 +02:00

@polkadot/wasm

Various WASM wrappers around Rust crates

overview

It is split up into a number of internal packages, namely utilities -

  • wasm-crypto Various hashing functions, sr25519 & ed25519 crypto

These are split from the polkadot-js/util repo where it is heavily used as part of @polkadot/util-crypto. (There JS fallbacks are available for some interfaces, e.g. hashing, but for sr25519 WASM is the only interface). Since these don't undergo massive changes on a daily basis and has a build overhead (WASM compilation & optimisation), it is better managed as a seperate repo with a specific CI configuration.

development

Contributions are welcome!

To start off, this repo (along with others in the @polkadot family) uses yarn workspaces to organise the code. As such, after cloning, its dependencies should be installed via yarn, not via npm; the latter will result in broken dependencies.

Description
Fork of polkadot-js/wasm. Adds ML-DSA-65/87 and Poseidon2-over-Goldilocks to the @polkadot/wasm-crypto build, wrapping the chain's own qp-rusty-crystals-dilithium / qp-poseidon-core / qp-rusty-crystals-hdwallet crates so the browser and the runtime share one implementation.
Readme Apache-2.0 32 MiB
Languages
Rust 45.7%
JavaScript 25.1%
TypeScript 25%
Shell 4%
HTML 0.2%