Skip to content

feat: add Vara Network (VARA, coin type 913) and two-byte SS58 prefix support - #418

Open
HAPPYS1NGH wants to merge 3 commits into
ensdomains:masterfrom
HAPPYS1NGH:feat/vara-coin
Open

HAPPYS1NGH wants to merge 3 commits into
ensdomains:masterfrom
HAPPYS1NGH:feat/vara-coin

Conversation

@HAPPYS1NGH

@HAPPYS1NGH HAPPYS1NGH commented Oct 1, 2026 •

Copy link
Copy Markdown

Closes #417

Changes

  • SS58 helpers (utils/dot.ts) now encode/decode two-byte network prefixes (64–16383) — Vara uses prefix 137 — any Substrate chain with a high prefix can now be added in a few lines.
  • Decoder checks the decoded length — 1.1.4 accepts a valid address with bytes appended after the checksum and returns the same key — malformed SS58 input is now rejected.
  • createDotAddressEncoder/Decoder throw on an out-of-range prefix at creation — previously new Uint8Array([type]) silently wrapped it — misconfiguration fails loudly.
  • Added vara (coin type 913, SS58 prefix 137), registered in coins.ts, coders.ts, coinTypeToNameMap.ts and the supported-coins doc — Vara addresses resolve through ENS.
  • Tests: Vara encode/decode vectors, rejection of a Polkadot address, a bad checksum and a truncated address, plus a dot regression test for trailing bytes.

Notes

  • References: SLIP-44 913 VARA Vara Network; ss58-registry prefix: 137, network: "vara"; SS58 address format.
  • Test vectors: the Substrate dev accounts Alice and Bob plus a live Vara account, all checked against @polkadot/util-crypto encodeAddress(pubkey, 137).
  • Verified: bun test 1368 pass / 0 fail, bun run build passes. dot and ksm vectors are unchanged.
  • Cross-check (not committed): compared the built helpers to @polkadot/util-crypto across every one-byte prefix, the 63/64 and 16383 boundaries, 137 and 40 random two-byte prefixes, in both directions (11,391 checks, 0 failures). Every single-character corruption of a Vara address is rejected.
  • No new dependencies. It reuses @noble/hashes and the existing base58 helpers.
  • Not touched: the docs generator also re-pads the EVM table, which is already out of date on master; I left that out to keep the diff focused.

🤖 Generated with Claude Code

HAPPYS1NGH and others added 3 commits October 1, 2026 22:52
…loads

createDotAddressEncoder/createDotAddressDecoder only handled one-byte SS58
prefixes (0-63). Prefixes 64-16383 use the two-byte form, which networks
such as Vara (137) need.

The decoder now also checks the decoded length, so addresses with extra
bytes after the checksum are rejected instead of decoding to the same key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUht7n9jsGGGLoHwCCpYKD
Vara addresses are SS58 with network prefix 137 (ss58-registry) and
SLIP-44 coin type 913.

Closes ensdomains#417

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUht7n9jsGGGLoHwCCpYKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Vara Network (VARA, coin type 913) and two-byte SS58 prefix support

1 participant