Skip to content

Commit abf759e

Browse files
committed
Add TRON namespace
1 parent 46e0712 commit abf759e

2 files changed

Lines changed: 129 additions & 0 deletions

File tree

tron/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
namespace-identifier: tron
3+
title: TRON Ecosystem
4+
author: Daniel Rocha (@danroc)
5+
status: Draft
6+
type: Informational
7+
created: 2025-07-15
8+
requires:
9+
- CAIP-2
10+
---
11+
12+
# Namespace for TRON chains
13+
14+
This document describes the syntax and structure of the [TRON] namespace.
15+
16+
## Syntax
17+
18+
The namespace "tron" refers to the TRON blockchain and its testnets.
19+
20+
## References
21+
22+
- [TRON]: TRON Website
23+
- [API]: TRON API documentation
24+
25+
[TRON]: https://tron.network/
26+
[API]: https://developers.tron.network/reference/
27+
28+
## Copyright
29+
30+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

tron/caip2.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
namespace-identifier: tron-caip2
3+
title: TRON Namespace – Chains
4+
author: Daniel Rocha (@danroc)
5+
status: Draft
6+
type: Standard
7+
created: 2025-07-15
8+
requires:
9+
- CAIP-2
10+
---
11+
12+
# CAIP-2
13+
14+
*For context, see the [CAIP-2] specification.*
15+
16+
## Rationale
17+
18+
In the TRON ecosystem, chain IDs uniquely identify each network. They are
19+
derived from the genesis block hash, as specified in [TIP-474].
20+
21+
## Syntax
22+
23+
A [CAIP-2] chain ID for a TRON network uses the `tron` namespace, and the
24+
reference portion is the decimal representation of the value returned by the
25+
[`eth_chainId`] RPC method.
26+
27+
In TRON, the RPC’s `eth_chainId` response is defined as the last four bytes of
28+
the genesis block hash. As a 32-bit value, it ranges from `0x00000000` through
29+
`0xFFFFFFFF`.
30+
31+
A full TRON CAIP-2 chain ID has the form:
32+
33+
```text
34+
tron:<decimal-chain-id>
35+
```
36+
37+
## Resolution Mechanics
38+
39+
To obtain the chain ID, send an `eth_chainId` JSON-RPC request to a TRON node:
40+
41+
```json5
42+
// Request
43+
{
44+
"id": 1,
45+
"jsonrpc": "2.0",
46+
"method": "eth_chainId",
47+
"params": []
48+
}
49+
50+
// Response
51+
{
52+
"id": 1,
53+
"jsonrpc": "2.0",
54+
"result": "0x2b6653dc"
55+
}
56+
```
57+
58+
The `result` field is a hexadecimal string. Convert it to a base-10 integer to
59+
obtain the CAIP-2 reference:
60+
61+
```text
62+
0x2b6653dc → 728126428
63+
```
64+
65+
Thus, the Mainnet CAIP-2 chain ID becomes:
66+
67+
```text
68+
tron:728126428
69+
```
70+
71+
## Test Cases
72+
73+
Here are some common TRON networks and their CAIP-2 chain IDs:
74+
75+
```text
76+
# TRON Mainnet
77+
tron:728126428
78+
79+
# TRON Testnet – Shasta
80+
tron:2494104990
81+
82+
# TRON Testnet – Nile
83+
tron:3448148188
84+
```
85+
86+
## References
87+
88+
- [CAIP-2]: CAIP-2 Specification
89+
- [TIP-474]: TRON Improvement Proposal for chain-ID generation
90+
- [`eth_chainId`]: TRON JSON-RPC method documentation
91+
92+
## Copyright
93+
94+
All rights waived via [CC0].
95+
96+
[CAIP-2]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
97+
[TIP-474]: https://github.com/tronprotocol/tips/blob/master/tip-474.md
98+
[`eth_chainId`]: https://developers.tron.network/reference/eth_chainid
99+
[CC0]: https://creativecommons.org/publicdomain/zero/1.0/

0 commit comments

Comments
 (0)