Repository navigation
feat: add Vara Network (VARA, coin type 913) and two-byte SS58 prefix support - #418
Open
HAPPYS1NGH wants to merge 3 commits into
Open
HAPPYS1NGH wants to merge 3 commits into
HAPPYS1NGH wants to merge 3 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #417
Changes
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.createDotAddressEncoder/Decoderthrow on an out-of-range prefix at creation — previouslynew Uint8Array([type])silently wrapped it — misconfiguration fails loudly.vara(coin type 913, SS58 prefix 137), registered incoins.ts,coders.ts,coinTypeToNameMap.tsand the supported-coins doc — Vara addresses resolve through ENS.dotregression test for trailing bytes.Notes
913 VARA Vara Network; ss58-registryprefix: 137, network: "vara"; SS58 address format.@polkadot/util-cryptoencodeAddress(pubkey, 137).bun test1368 pass / 0 fail,bun run buildpasses.dotandksmvectors are unchanged.@polkadot/util-cryptoacross 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.@noble/hashesand the existing base58 helpers.🤖 Generated with Claude Code