Skip to content

Implement support for Sui (SUI) blockchain (784) with encoding and decoding functions#409

Merged
TateB merged 3 commits intoensdomains:masterfrom
arbuthnot-eth:feature/add-sui-support
Aug 25, 2025
Merged

Implement support for Sui (SUI) blockchain (784) with encoding and decoding functions#409
TateB merged 3 commits intoensdomains:masterfrom
arbuthnot-eth:feature/add-sui-support

Conversation

@arbuthnot-eth
Copy link
Contributor

@arbuthnot-eth arbuthnot-eth commented Aug 13, 2025

This PR adds support for the Sui blockchain to the address-encoder library.

Summary

  • Added Sui address encoding/decoding functionality
  • Sui addresses are 32-byte values represented as a "0x" prefix followed by 64 lowercase hexadecimal characters
  • No checksum validation is needed as per Sui's specification
  • Added comprehensive test cases

Technical Details

  • Coin Type: 784 (from SLIP-44)
  • Address Format: 32-byte hex string with "0x" prefix
  • Encoding: Convert 32 bytes to lowercase hex and prepend "0x"
  • Decoding: Strip "0x" prefix and convert 64 hex chars to 32 bytes
  • Validation: Regex pattern /^0x[a-f0-9]{64}$/ (case-insensitive input, lowercase output)

Files Added/Modified

  • Added: src/coin/sui.ts - Sui address encoding/decoding functions
  • Added: src/coin/sui.test.ts - Test cases for Sui addresses
  • Modified: src/coders.ts - Added Sui export
  • Modified: src/coins.ts - Added Sui to coins list
  • Modified: src/consts/coinTypeToNameMap.ts - Added Sui to coin type mapping

References

All tests are passing (1352 tests across 128 files).
Fixes #408

@TateB TateB merged commit 9ffe0eb into ensdomains:master Aug 25, 2025
2 checks passed
@arbuthnot-eth arbuthnot-eth deleted the feature/add-sui-support branch December 31, 2025 20:52
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.

Feature Request: Add support for Sui (SUI) chain with coin type 784

2 participants