Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIP-191: Signed Data Standard #442

Closed
yanghang8612 opened this issue Jul 25, 2022 · 1 comment
Closed

TIP-191: Signed Data Standard #442

yanghang8612 opened this issue Jul 25, 2022 · 1 comment

Comments

@yanghang8612
Copy link
Contributor

yanghang8612 commented Jul 25, 2022

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.

Registry of version bytes

Version byte TIP Description
0x00 191 Data with intended validator
0x01 712 Structured 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.

@yanghang8612
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant