tip: 191
title: Signed Data Standard
author: yanghang8612@163.com
discussions to: https://github.com/tronprotocol/TIPs/issues/442
status: Draft
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.
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.
Close this issue as there has been no new discussion for more than 6 months.
The community has decided to adopt this issue.
Check TIP detail at TIP-191.
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
The format is totaly cmpatible with
EIP-191
.Version
0
has<20 byte address>
for the version specific data, and theaddress
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 thesigned_data
is not valid beginning byte forTransaction
andBlock
. Because in TRON protocol, the bytestrings transformed by the protobuf structure ofTransaction.raw
andBlock.Header
cannot start with0x19
.Registry of version bytes
0x00
0x01
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 iskeccak256
.