Skip to content

Conversation

@riveign
Copy link

@riveign riveign commented Jan 27, 2026

Summary

This PR adds the Tron namespace to the Chain Agnostic Namespaces repository, implementing CAIP-2 (Blockchain ID) and CAIP-10 (Account ID) specifications.

Networks Supported

  • Tron Mainnet (tron:0x2b6653dc)
  • Tron Shasta Testnet (tron:0xcd8690dc)
  • Tron Nile Testnet (tron:0x94a9059e)

Files Added

  • tron/README.md - Namespace overview and introduction
  • tron/caip2.md - CAIP-2 blockchain ID specification
  • tron/caip10.md - CAIP-10 account ID specification

Key Features

  • Hexadecimal chain ID format aligned with TIP-474
  • Resolution methods via eth_chainId JSON-RPC
  • Comprehensive test cases for all networks
  • Base58Check address validation
  • Support for TRC-20, TRC-10, and TRC-721 token standards

References

Testing

All test cases have been included in the specification documents with valid and invalid examples.

@riveign riveign marked this pull request as draft January 27, 2026 10:43
- Add tron/ namespace directory with comprehensive documentation
- Implement CAIP-2 blockchain ID specification using hexadecimal chain IDs
- Implement CAIP-10 account ID specification for Base58Check addresses
- Include test cases for Mainnet (0x2b6653dc), Shasta (0xcd8690dc), and Nile (0x94a9059e)
- Document resolution methods using eth_chainId JSON-RPC
- Follow TIP-474 standard for chain ID derivation from genesis block

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@riveign riveign force-pushed the add-tron-namespace branch from 85d5f7a to a058588 Compare January 27, 2026 10:49
@riveign riveign marked this pull request as ready for review January 27, 2026 10:53
@bumblefudge
Copy link
Collaborator

Whoops, sorry, did you notice #162 ?


- **Mainnet**: `https://api.trongrid.io/jsonrpc`
- **Shasta**: `https://api.shasta.trongrid.io/jsonrpc`
- **Nile**: `https://nile.trongrid.io/jsonrpc`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to link here to some canonical, authoritative, and/or Foundation-funded source for RPC and chainId information, as these examples will probably be out of date in a year or three?


## Backwards Compatibility

Prior to TIP-474, Tron did not have a standardized chain ID mechanism for cross-chain identification.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Prior to TIP-474, Tron did not have a standardized chain ID mechanism for cross-chain identification.
Prior to [TIP-474], Tron did not have a standardized chain ID mechanism for cross-chain identification.

Tron chains are identified using hexadecimal chain IDs derived from the last 4 bytes of their genesis block hashes, as specified in TIP-474.
This approach provides:
- Deterministic chain identification from genesis block
- Compatibility with EVM tooling through `eth_chainId` method
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but doesn't eth_chainId take integers (1), not bytestrings (0x01)?


### Reference Definition

The reference format for Tron chains uses the hexadecimal representation of the chain ID, prefixed with `0x`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not understanding the 0x prefix: even though it's derived from a bytestring (the genesis hash), it still seems to me like the basic type is integer, not bytestring? Note also that #162 , which was approved but not merged before this PR was opened, went the integer root, which seems more ergonomic to me (if nothing else because it's shorter and easier to validate)

namespace-identifier: tron-caip10
title: Tron Namespace - Account ID Specification
author: WalletConnect Team
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/XXX
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/XXX
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/170

---
namespace-identifier: tron-caip10
title: Tron Namespace - Account ID Specification
author: WalletConnect Team
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you trying to tell me WC has a no airdrop-farming policy now? Put one or more github handles in here of the specific people who did this fine work!

Copy link
Collaborator

@bumblefudge bumblefudge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Despite all the nitpicky comments above, I am super grateful for this very thorough and explicit PR, I wish all the namespaces were this detailed.

The little things are little things, but there is one thing really blocking me from closing #162 as redundant (for being less detailed), adding its author (@danroc ) to the author list here, and merging this: the CAIP-2 0x prefix. Between the weakly-held argument made inline and CASA's first-over-the-pole policy when contributors disagree about aesthetics, I tend to prefer the terser expression, but happy to hear arguments in favor of the 0x?

@danroc
Copy link
Contributor

danroc commented Jan 29, 2026

Hey @bumblefudge, thanks for the ping. I left CAIP-10 out of the PR because I wasn’t sure whether I should cover Hex addresses.

We used the integer format since it seems to be the most common and matches what we do in other namespaces (like eip155).

On the level of detail, I tried to keep the spec pretty minimal. Happy to add more if needed, and I’ll keep that in mind next time!

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.

3 participants