Skip to content

Commit 463bae5

Browse files
authored
Add Tron namespace with CAIP-2 and CAIP-10 specifications (#170)
2 parents df9e18a + b5104cc commit 463bae5

3 files changed

Lines changed: 451 additions & 0 deletions

File tree

‎tron/README.md‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
namespace-identifier: tron
3+
title: Tron Ecosystem
4+
author: Ignacio Rivera (@riveign), Daniel Rocha (@danroc)
5+
status: Draft
6+
type: Informational
7+
created: 2026-01-27
8+
---
9+
10+
# Namespace for Tron Chains
11+
12+
This document describes the syntax and structure of the Tron namespace.
13+
Tron is a decentralized blockchain platform that utilizes Delegated Proof of Stake (DPoS) consensus and features the Tron Virtual Machine (TVM), which is compatible with the Ethereum Virtual Machine (EVM).
14+
15+
## Introduction
16+
17+
Tron is a blockchain-based decentralized platform founded in 2017 that aims to build a free, global digital content entertainment system utilizing blockchain and distributed storage technology.
18+
The Tron network supports smart contracts through its TVM (Tron Virtual Machine) and provides high throughput with approximately 2,000 transactions per second and 3-second block times.
19+
20+
The Tron ecosystem includes:
21+
- **Mainnet** (`tron:728126428`): Production network for live applications
22+
- **Shasta Testnet** (`tron:2494104990`): Testing environment compatible with mainnet parameters
23+
- **Nile Testnet** (`tron:3448148188`): Bleeding-edge testing network for new features
24+
25+
## Blockchain Identification
26+
27+
Tron chains are identified using decimal chain IDs, the unsigned 32-bit integer value of the last 4 bytes of their genesis block hashes, as specified in TIP-474.
28+
This approach provides:
29+
- Deterministic chain identification from genesis block
30+
- Compatibility with EVM tooling through the `eth_chainId` method, which returns the same value base-16-encoded
31+
- Replay protection across networks
32+
- Integration with existing blockchain infrastructure
33+
34+
## Token Standards
35+
36+
Tron supports multiple token standards:
37+
- **TRC-20**: Fungible token standard (similar to ERC-20)
38+
- **TRC-10**: Native token standard with lower transaction costs
39+
- **TRC-721**: Non-fungible token (NFT) standard
40+
41+
## Address Format
42+
43+
Tron uses Base58Check encoding for addresses:
44+
- All addresses start with the letter `T`
45+
- Addresses are exactly 34 characters long
46+
- Example: `TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL`
47+
48+
## Network Information
49+
50+
### Mainnet
51+
- **RPC Endpoint**: `https://api.trongrid.io`
52+
- **JSON-RPC Endpoint**: `https://api.trongrid.io/jsonrpc`
53+
- **Explorer**: `https://tronscan.org`
54+
- **Native Currency**: TRX (6 decimals, 1 TRX = 1,000,000 SUN)
55+
56+
### Shasta Testnet
57+
- **RPC Endpoint**: `https://api.shasta.trongrid.io`
58+
- **JSON-RPC Endpoint**: `https://api.shasta.trongrid.io/jsonrpc`
59+
- **Explorer**: `https://shasta.tronscan.org`
60+
- **Faucet**: Available at https://www.trongrid.io/shasta
61+
62+
### Nile Testnet
63+
- **RPC Endpoint**: `https://nile.trongrid.io`
64+
- **JSON-RPC Endpoint**: `https://nile.trongrid.io/jsonrpc`
65+
- **Explorer**: `https://nile.tronscan.org`
66+
67+
## References
68+
69+
- [Tron Developer Hub][]: Official Tron development documentation
70+
- [TIP-474][]: Tron Improvement Proposal specifying chain ID derivation
71+
- [TronGrid][]: Official Tron API service
72+
- [TronWeb][]: JavaScript SDK for Tron blockchain
73+
- [Tronscan][]: Tron blockchain explorer
74+
75+
[Tron Developer Hub]: https://developers.tron.network/
76+
[TIP-474]: https://github.com/tronprotocol/tips/blob/master/tip-474.md
77+
[TronGrid]: https://www.trongrid.io/
78+
[TronWeb]: https://tronweb.network/
79+
[Tronscan]: https://tronscan.org/
80+
[CAIP-2]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
81+
[CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md
82+
83+
## Rights
84+
85+
Copyright and related rights waived via CC0.

‎tron/caip10.md‎

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
---
2+
namespace-identifier: tron-caip10
3+
title: Tron Namespace - Account ID Specification
4+
author: Ignacio Rivera (@riveign), Daniel Rocha (@danroc)
5+
discussions-to: https://github.com/ChainAgnostic/namespaces/pull/170
6+
status: Draft
7+
type: Standard
8+
created: 2026-01-27
9+
requires: ["CAIP-2", "CAIP-10"]
10+
---
11+
12+
# CAIP-10
13+
14+
*For context, see the [CAIP-10][] specification.*
15+
16+
## Rationale
17+
18+
Tron addresses use Base58Check encoding and are derived from ECDSA public keys using the secp256k1 curve (same as Ethereum).
19+
All Tron addresses:
20+
- Start with the letter `T` (due to the `0x41` address prefix)
21+
- Are exactly 34 characters in length
22+
- Include a 4-byte checksum for error detection
23+
- Are case-sensitive
24+
25+
The address format provides both human readability and built-in validation through the checksum mechanism.
26+
27+
## Syntax
28+
29+
The syntax of a Tron address follows Base58Check encoding with the following constraints:
30+
31+
**Regular Expression**: `^T[1-9A-HJ-NP-Za-km-z]{33}$`
32+
33+
Where:
34+
- First character is always `T`
35+
- Remaining 33 characters use Base58 alphabet (excluding 0, O, I, l)
36+
- Total length is exactly 34 characters
37+
38+
### Address Generation
39+
40+
Tron addresses are generated through the following process:
41+
1. Generate ECDSA key pair using secp256k1 curve
42+
2. Extract 64-byte public key
43+
3. Hash with Keccak256 (SHA3)
44+
4. Take last 20 bytes of hash
45+
5. Prepend address prefix byte `0x41`
46+
6. Double SHA256 hash and append first 4 bytes as checksum
47+
7. Base58 encode the result
48+
49+
## Chain IDs
50+
51+
*For context, see the [CAIP-2][] specification.*
52+
53+
| Network | Chain ID | Chain ID (CAIP-2) |
54+
|----------------|--------------|-------------------|
55+
| Mainnet | `728126428` | `tron:728126428` |
56+
| Shasta Testnet | `2494104990` | `tron:2494104990` |
57+
| Nile Testnet | `3448148188` | `tron:3448148188` |
58+
59+
## Test Cases
60+
61+
This is a list of manually composed and validated examples:
62+
63+
```bash
64+
# Tron Mainnet - Standard account address
65+
tron:728126428:TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL
66+
67+
# Tron Mainnet - USDT TRC-20 contract address
68+
tron:728126428:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
69+
70+
# Tron Shasta Testnet
71+
tron:2494104990:TQQg4EL8o1BSeKJY4MJ8TB8XK7xufxFBvK
72+
73+
# Tron Nile Testnet
74+
tron:3448148188:TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH
75+
```
76+
77+
## Address Validation
78+
79+
### Valid Address Examples
80+
81+
```
82+
TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL ✓ Valid mainnet address
83+
TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t ✓ Valid mainnet address (USDT contract)
84+
TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH ✓ Valid address
85+
```
86+
87+
### Invalid Address Examples
88+
89+
```
90+
tNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL ✗ Lowercase 't' (must be uppercase 'T')
91+
TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYq ✗ Too short (33 characters)
92+
TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeLL ✗ Too long (35 characters)
93+
0x742d35Cc6634C0532925a3b844Bc9e759 ✗ Hex format (not Base58Check)
94+
```
95+
96+
## Account Types
97+
98+
Tron supports two types of accounts:
99+
100+
1. **Externally Owned Account (EOA)**:
101+
- Controlled by private key
102+
- Can initiate transactions
103+
- Example: `TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL`
104+
105+
2. **Contract Account**:
106+
- Smart contract address
107+
- No private key
108+
- Can only respond to transactions
109+
- Example: `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t` (USDT TRC-20)
110+
111+
Both account types use the same address format and are indistinguishable at the address level.
112+
113+
## Backwards Compatibility
114+
115+
Tron's address format has remained consistent since mainnet launch.
116+
All existing addresses are compatible with the CAIP-10 specification.
117+
118+
## Additional Considerations
119+
120+
### Checksum Validation
121+
122+
The Base58Check encoding includes a 4-byte checksum that should be validated when accepting addresses.
123+
Invalid checksums indicate:
124+
- Typographical errors in address entry
125+
- Data corruption
126+
- Invalid address generation
127+
128+
### Address Activation
129+
130+
Tron addresses must be activated by receiving TRX or TRC-10 tokens before they appear on-chain.
131+
Unactivated addresses:
132+
- Are valid addresses (correct format and checksum)
133+
- Do not appear in blockchain state queries
134+
- Will be created upon receiving first transaction
135+
136+
### Multi-signature Addresses
137+
138+
Tron supports multi-signature accounts with the same address format.
139+
Multi-sig addresses cannot be distinguished from regular addresses without querying account permissions on-chain.
140+
141+
## Resolution Method
142+
143+
To verify an address exists on-chain, make a JSON-RPC request using Tron's native RPC methods:
144+
145+
```jsonc
146+
// Request - Get account balance
147+
{
148+
"jsonrpc": "2.0",
149+
"method": "tron_getBalance",
150+
"params": {
151+
"address": "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL"
152+
},
153+
"id": 1
154+
}
155+
156+
// Response
157+
{
158+
"jsonrpc": "2.0",
159+
"result": {
160+
"balance": "1000000000"
161+
},
162+
"id": 1
163+
}
164+
```
165+
166+
Alternatively, using Tron's native HTTP API:
167+
168+
```bash
169+
curl -X POST https://api.trongrid.io/wallet/getaccount \
170+
-d '{"address":"TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL","visible":true}'
171+
```
172+
173+
## References
174+
175+
- [CAIP-10][]: Account ID Specification
176+
- [CAIP-2][]: Chain ID Specification
177+
- [Tron Developer Hub - Accounts][]: Official account documentation
178+
- [Tron Address Format][]: Technical specification for address generation
179+
- [Base58Check Encoding][]: Bitcoin Base58Check encoding specification
180+
181+
[CAIP-2]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md
182+
[CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md
183+
[Tron Developer Hub - Accounts]: https://developers.tron.network/docs/account
184+
[Tron Address Format]: https://tronprotocol.github.io/documentation-en/mechanism-algorithm/account/
185+
[Base58Check Encoding]: https://en.bitcoin.it/wiki/Base58Check_encoding
186+
187+
## Copyright
188+
189+
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 commit comments

Comments
 (0)