tip: 191
title: Signed Data Standard
author: [email protected]
discussions to: https://github.com/tronprotocol/TIPs/issues/442
status: Final
type: Standards Track
category: TRC
created: 2022-07-25
This TIP proposes a specification about how to handle signed data in TRON contracts.
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.
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
.
Version byte | TIP | Description |
---|---|---|
0x00 |
191 | Data with intended validator |
0x01 |
712 | Structured data |
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
.