rob thijssen e6ff57a334 feat: storage addressing, nested calls, and a stated integer convention
Three things the tier-1 case matrix needed (quantus/extension#7).

**Storage keys and values (#4).** `storage_target` resolves a pallet and item to
`twox128(prefix) ‖ twox128(item)` plus each map key hashed by the hasher the
entry declares, and reports the value type and the entry's default.
`decode_storage_value` reads the result. Nothing here knows that `System::Account`
is a `Blake2_128Concat` map over an `AccountId32`; the hashers, both types and
the default all come out of the metadata.

The `Default` versus `Optional` distinction is carried deliberately. A `Default`
entry that the node returns nothing for means the declared default — an account
nobody has funded reads as a zero balance — where an `Optional` one means
nothing. A wallet that conflated them would report a failure for an account that
simply has no money in it.

**A call nests inside a call.** A multi-field variant with named fields only
accepted a positional array, so `Utility.batch_all` — whose `Vec<RuntimeCall>`
holds calls spelled exactly like top-level ones — could not be encoded at all. It
now takes the same object form at any depth.

**Every integer renders as a decimal string**, whatever its width, and that is
now stated rather than incidental. A u128 balance does not survive a JSON number
(12 decimal places puts ordinary amounts past 2^53) and `scale_value` widens
every unsigned integer to u128, so the width is not available to switch on.
Emitting a number when it happens to fit and a string when it does not would make
a consumer handle both shapes for the same field depending on the value.

All of it proven against Heisenberg: an ML-DSA-65 account funded by a `batch_all`
whose payload crossed the 256-byte BLAKE2b threshold, then signing and being
included itself.

Closes #4. Refs #3

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012uDUodEcRbBwNRi3UCmw8f
2026-09-15 15:15:35 +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%