The evolution of blockchain technology necessitates standardized protocols for address representation to ensure seamless interaction and integration across various platforms. This paper examines the TON Enhancement Proposal (TEP-2), titled “TON Addresses,” which establishes a comprehensive framework for the representation of addresses within the TON (The Open Network) blockchain ecosystem. This framework is pivotal for developers, users, and wallet applications, facilitating a more intuitive and error-resistant way to handle blockchain addresses.
Introduction to TON Address Types
TEP-2 delineates several address types within the TON blockchain, including smart-contract addresses, public keys, and ADNL (Abstract Data Network Layer) addresses. Each address type serves distinct purposes, from identifying smart contracts to facilitating secure communications within the TON network.
Smart-Contract Addresses
Smart-contract addresses in TON are bifurcated into workchain IDs and addresses within those workchains, primarily focusing on the masterchain and basic workchain, which utilize 256-bit addresses. TEP-2 specifies two primary representations for these addresses:
- Raw Format: A straightforward representation featuring the decimal workchain ID followed by a 64-character hexadecimal address.
- User-Friendly Format: A more accessible version that employs a base64 or base64url encoding, incorporating a tag byte, workchain ID, address bytes, and a checksum for error detection.
Example Representation
Address Type | Representation |
---|---|
Raw | -1:e56754f83426f69b09267bd876ac97c44821345b7e266bd956a7bfbfb98df35c |
User-Friendly (B64) | Ef_lZ1T4NCb2mwkme9h2rJfESCE0W34ma9lWp7-_uY3zXDvq (Bounceable) |
User-Friendly (B64) | Uf_lZ1T4NCb2mwkme9h2rJfESCE0W34ma9lWp7-_uY3zXGYv (Non-Bounceable) |
Public Keys and ADNL Addresses
Public keys, specifically the 256-bit Ed25519 keys, and ADNL addresses, which underpin the TON’s network protocol, are also standardized under TEP-2. Similar to smart-contract addresses, these entities are represented in both raw and user-friendly (armored) formats, with the latter incorporating a base64(base64url) encoding for public keys and a base32 encoding for ADNL addresses.
Implications for Wallet Applications
TEP-2’s standardization has direct implications for TON wallet applications, influencing how addresses are displayed and processed for transactions. Key considerations include:
- Receiving Addresses: Wallets are encouraged to display user-friendly, bounceable forms of addresses to enhance usability.
- Sending Addresses: Wallets must validate destination addresses for correctness, network compatibility (mainnet vs. testnet), and bounceable/non-bounceable status, ensuring transactions are executed as intended.
Operational Guidelines for Wallets
Operation | Guidelines |
---|---|
Address Validation | Check for valid length, characters, prefix, and checksum. |
Network Compatibility Checks | Ensure addresses are compatible with the wallet’s network (mainnet/testnet). |
Bounceable Flag Retrieval | Determine the bounceable status from the address for message sending. |
Transaction Execution | Based on the address’s state (initialized/uninitialized) and bounceable status, appropriately set the bounce field of the sending message. |
Challenges and Considerations
While TEP-2 significantly enhances the usability and safety of handling TON addresses, it introduces challenges related to user interface design, particularly the selection difficulty caused by base64 symbols. Additionally, the inability to extract public keys directly from addresses poses limitations for certain on-chain operations.
Conclusion
The TEP-2 proposal for TON addresses represents a critical step towards standardizing blockchain address representations, ensuring that users and developers can interact with the TON blockchain more efficiently and securely. By establishing clear guidelines for address formats and their handling by wallet applications, TEP-2 facilitates a more user-friendly and error-resistant blockchain ecosystem. Future enhancements and proposals may further refine these standards to address the evolving needs of the TON community and its technological infrastructure.