tip-191.md

April 3, 2025 · View on GitHub

tip: 191
title: Signed Data Standard
author: yanghang8612@163.com
discussions to: https://github.com/tronprotocol/TIPs/issues/442
status: Final
type: Standards Track
category: TRC
created: 2022-07-25

Abstract

This TIP proposes a specification about how to handle signed data in TRON contracts.

Motivation

Off-chain message signing for use on-chain now is widely used by some multisignature wallet implementations and tokens with permit method.

However, there is currently no standard for off-chain message signing for TRON protocol, so this TIP aims to introduce an signed data standard similar to EIP-191.

Specification

We propose the following format for signed_data

0x19 <1 byte version> <version specific data> <data to sign>.

The format is totaly cmpatible with EIP-191.

Version 0 has <20 byte address> for the version specific data, and the address is the intended validator. In the case of a Multisig wallet, that is the wallet’s own address.

The initial 0x19 byte is intended to ensure that the signed_data is not valid beginning byte for Transaction and Block. Because in TRON protocol, the bytestrings transformed by the protobuf structure of Transaction.raw and Block.Header cannot start with 0x19.

Registry of version bytes

Version byteTIPDescription
0x00191Data with intended validator
0x01712Structured data

Signatures and Hashing

A signature scheme consists of hashing algorithm and a signing algorithm. The signing algorithm of choice is secp256k1. The hashing algorithm of choice is keccak256.

Copyright and related rights waived via CC0.