Files
bridge/internal
zeekay a560468888 feat(substrate): SCALE codec, SS58 encoder, signed extrinsic builder
Add internal/substrate package containing the minimal Polkadot wire
primitives the bridge needs to sign + broadcast balances.transfer_keep_alive
extrinsics:

- SCALE codec primitives (compact ints, fixed-width LE ints, byte slices
  bare + length-prefixed) — enough to encode ExtrinsicPayloadV4 + a v4
  signed extrinsic. Not a general reflection-driven encoder.
- AccountId32 derivation from a compressed secp256k1 pubkey via
  blake2_256 — matches sp_io::hashing::blake2_256 on the runtime side.
- SS58 base58check encoder + decoder with single-byte network prefixes
  (Polkadot=0, Kusama=2, generic=42). Verified against the canonical
  Alice fixture in both Polkadot mainnet ("15oF4u...") and substrate
  generic ("5Grwva...") forms.
- ExtrinsicPayloadV4 builder: SCALE(call) || era || nonce || tip ||
  spec_version || tx_version || genesis_hash || block_hash, with the
  >256-byte → blake2_256 hashing rule.
- v4 signed-extrinsic assembler: 0x84 version byte || MultiAddress::Id
  signer (33B) || MultiSignature(scheme, sig) || era || nonce || tip ||
  call, length-prefixed compact-style.

The substrate primitives are leaf code with no network I/O. Test vectors
are pinned against the Polkadot JS SDK and substrate runtime references.
2026-05-27 17:43:16 -07:00
..
2026-05-27 14:49:55 +02:00
2026-05-27 14:49:55 +02:00