Skip to content

Instantly share code, notes, and snippets.

@dbuarque
Last active March 31, 2023 10:49
Show Gist options
  • Save dbuarque/42224e091d19e058a839bb6b87c9689c to your computer and use it in GitHub Desktop.
Save dbuarque/42224e091d19e058a839bb6b87c9689c to your computer and use it in GitHub Desktop.
Tron Deterministic Wallet Proposal

Tron Deterministic Wallet Proposal (TWP)

Preamble

TWP: 0001
Title: Tron Wallet Proposal - Key Derivation Methods for Tron Accounts with BIP39
Author: getty.io
Created: 2017-04-05

Simple Summary

This Tron Wallet Proposal describes methods for key derivation. This should improve key storage and moving keys between wallets and apps.

Motivation

Currently the only way to store Tron account's keys is by saving a long str-encoded string which represents a secret key. However many industry standards have been developed for deriving keys which improve key storage and moving keys between wallets. Adapting these standards for Tron accounts should improve Tron wallets by:

  • making key derivation the same across wallets and apps,
  • allowing users to hold keys in hardware wallets,
  • allowing users to hold keys in cold storage more reliably (using mnemonic codes),
  • allowing users to generate multiple keys from a single seed (ex. first for storing funds and second as a signer for a shared account).

Specification

Multi-Account Hierarchy for Deterministic Wallets

We adapt BIP-0044 for generating deterministic wallets, with coin_type equal 195 as assigned in SLIP-0044.

The following path should be used to generate accounts: m/44'/195'/x'. We call m/44'/195'/0' the primary account.

Mnemonic Codes

BIP-0039 should be used to derive binary seed from a mnemonic code.

We strongly recommend using 24 word mnemonic (256 bits of entropy).

Rationale

BIPs are industry standards used by a majority of cryptocurrencies and software/hardware wallets.

We decided not to use the full derivation path specified in BIP-0044 and follow the standard proposed by Stellar Lumens team SEP-005

Test Cases

Test 1

---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/0'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  4FD87C202D554308FC76E63F036776DA19517431
Password:  0VG7sOE7VFffNq//5M+pQeSSjDtsBobsqyKWUXXYlvk=
Private Key: D151BBB0E13B5457DF36AFFFE4CFA941E4928C3B6C0686ECAB22965175D896F9
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/1'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  385D464670E95FB87AC4A515909A0DF96C533F5A
Password:  OK6mXLMX+0CahQ5fD3bBhlsQ54dctsB9df3cQEoyxOE=
Private Key: 38AEA65CB317FB409A850E5F0F76C1865B10E7875CB6C07D75FDDC404A32C4E1
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/2'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  B9FE9C2AA7074AEA22696A1C4EFA9B2937CD4D7E
Password:  fDOODbjiK7uK3DSfE61Dj8He0M1nxkYbsUxiAS5bwrc=
Private Key: 7C338E0DB8E22BBB8ADC349F13AD438FC1DED0CD67C6461BB14C62012E5BC2B7
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/3'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  F2B6246B08C2EA81FE3F8DF5D54C13121E0153CB
Password:  fbcMVIsinJv0XdYvRpuk12qb6QwRVzz+jkIONs8g/LM=
Private Key: 7DB70C548B229C9BF45DD62F469BA4D76A9BE90C11573CFE8E420E36CF20FCB3
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/4'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  9D020FC6DAC423F800A85BB1C0810F82C971E5F4
Password:  YZ6w6ZRDNSfKUlU7sEaQNm9lNLChgrm9Euf0TFph52s=
Private Key: 619EB0E994433527CA52553BB04690366F6534B0A182B9BD12E7F44C5A61E76B
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/5'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  E42537267AC09174D6F3832E2A5C7E2C416CD00C
Password:  To44R7QFbbXi2E6iadFRSZ4tIHJBlF6kqWuqjUv53lM=
Private Key: 4E8E3847B4056DB5E2D84EA269D151499E2D207241945EA4A96BAA8D4BF9DE53
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/6'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  3CC9B3E7F806CA81C587EC027DB8DD2BB5FAAA25
Password:  MA/4Kpd/pi6vXNS/VLsGfBoLhKg6eP5/0OjlViB+aew=
Private Key: 300FF82A977FA62EAF5CD4BF54BB067C1A0B84A83A78FE7FD0E8E556207E69EC
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/7'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  73A88951D98EDDCB48B623F95D4518B586EB2506
Password:  Z3HbQtWwimZku9YF3pfIntripaisrXbfhdqJ3OvV5mI=
Private Key: 6771DB42D5B08A6664BBD605DE97C89EDAE2A5A8ACAD76DF85DA89DCEBD5E662
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/8'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  ECB9706694D7D09E9FCC87FFE03DC5049E427ECF
Password:  Hz6/CZ6tFSdmLDz7puoKY6CFcB4rVNXiLxnOAinYjC0=
Private Key: 1F3EBF099EAD1527662C3CFBA6EA0A63A085701E2B54D5E22F19CE0229D88C2D
---------------------------------------------------------------
Mnemonic (1 word): 00000000000000000000000000000000
BIP39 Path: m/44'/195'/9'
BIP39 Seed: 7cc00a1be98ba277b3e1640cabe994cf4dc5142bcf9a3bb4cdf7027356a08af3e5aabe0199e89e439313ddbdcb16e205e364b6e1519e4b0a4448b06a846ad4bb
Address:  09EA7D66415CCB4AB40CC4519CF50679B0DFF421
Password:  0DMlxFw9wtBbiSk8Ef1wYXtKHAN4xrBLEWOQzByfo2c=
Private Key: D03325C45C3DC2D05B89293C11FD70617B4A1C0378C6B04B116390CC1C9FA367
---------------------------------------------------------------

Test 2

---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/0'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  9390D93A67550F7796C07FECC92B66F6F923D016
Password:  +x0um9+z1GPFJwAwckqZMGZd9hu8/KGlidwETfXkxHo=
Private Key: FB1D2E9BDFB3D463C5270030724A9930665DF61BBCFCA1A589DC044DF5E4C47A
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/1'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  5F72FBDEB0A6B3F44034323456C2F12BB727CAE5
Password:  urPzDtBxJ+JFvo5nkOczz7y3yJzGxZmgIIz0fmuAn+4=
Private Key: BAB3F30ED07127E245BE8E6790E733CFBCB7C89CC6C599A0208CF47E6B809FEE
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/2'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  850D4C57AF1602CB7EBB6019231846C1CA123985
Password:  BE8pkvBuBg+5xtPD/Klr10GvaWLhDk42cTduKMU30Q8=
Private Key: 044F2992F06E060FB9C6D3C3FCA96BD741AF6962E10E4E3671376E28C537D10F
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/3'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  A812558A022189BACACD599AB5928BBA6B18D38A
Password:  LYvMz/TgtTupsTm4q3Z4TwArnUY+Zw9FUYU8THjq+L0=
Private Key: 2D8BCCCFF4E0B53BA9B139B8AB76784F002B9D463E670F4551853C4C78EAF8BD
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/4'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  B3394BD33FACD0576E737EF9845A034C3D0A07AE
Password:  iXSNurRNdepHpWkOuUaMZdLYoa47iopmxzspOGm7eFA=
Private Key: 89748DBAB44D75EA47A5690EB9468C65D2D8A1AE3B8A8A66C73B293869BB7850
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/5'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  1AB8DC7160426482A6C1FB76C0DEC673EDC28E01
Password:  uwFd0FpY6DVStW8tiYmaDFy2uuG76+smcpSy1qpOgIk=
Private Key: BB015DD05A58E83552B56F2D89899A0C5CB6BAE1BBEBEB267294B2D6AA4E8089
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/6'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  F213FE719490EDBC09601F89DFB1363B88B5B76F
Password:  aKsQmAbZ0e4ZsQc/W/L70xFCgUD5NQTeiTR6zwiai38=
Private Key: 68AB109806D9D1EE19B1073F5BF2FBD311428140F93504DE89347ACF089A8B7F
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/7'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  32A8CB8269F2589764CDE20B6999204CC1502C24
Password:  q0dULyExHC4Bom9ECiu0AoKs1qwHIRBSLUIhU7mquys=
Private Key: AB47542F21311C2E01A26F440A2BB40282ACD6AC072110522D422153B9AABB2B
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/8'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  C8D274E0F1EF367A0DD88C7FE24E6222291D9E56
Password:  aQFBN3fR7RkbNhhzQryU4SMLd5O/QucnZ2CWX+DbMDw=
Private Key: 6901413777D1ED191B36187342BC94E1230B7793BF42E7276760965FE0DB303C
---------------------------------------------------------------
Mnemonic (12 words): ceiling present easily example nurse silver ecology plug accident decrease special aware
BIP39 Path: m/44'/195'/9'
BIP39 Seed: e0977fc24a90cf457a12c3e074e337abefa2efab4646324a20c80c9308bc19f1be4cab879f6b7644841f3a2076b65421fca6eae42200b8b6e72efdb471ff4ac5
Address:  5F1C2B144758D5A6416B2BB0403E095F9AE89F21
Password:  vRGTJ2u78vQ4QwJZZngKUw75h2ZwWVQaacs43YzrJ7o=
Private Key: BD1193276BBBF2F43843025966780A530EF987667059541A69CB38DD8CEB27BA
---------------------------------------------------------------

Test 3

---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/0'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  3217053111709898699F85C5339BE65E3568C3B0
Password:  UHOS2WEmRkzmn0lNv6lW1etwUBgWbK1F+YjWK6tMCbE=
Private Key: 507392D96126464CE69F494DBFA956D5EB705018166CAD45F988D62BAB4C09B1
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/1'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  E1A524305B26888960DDEAC34290E1F446BFDABB
Password:  0sLcf8ly/jstnmRu6JoT0BSCGksKVnH4s/btil62dpc=
Private Key: D2C2DC7FC972FE3B2D9E646EE89A13D019521A4B0A5671F8B3F6ED8A5EB67697
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/2'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  D3C04C9EA43C76F85A8045C8DB3182177872C9A3
Password:  PGmcos7OWHV1HEFcIUUeF2Ib9edXrWGlWpe1XapjIiA=
Private Key: 3C699CA2CECE5875751C415C21451E17621BF5E757AD61A55A97B55DAA632220
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/3'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  C63AFF90AC68977A9BF744E213C5F6EEAC286314
Password:  7AnXzwNCmoMAmsvu1YfjfFYe2IqGlbIucbiiHyouH/s=
Private Key: EC09D7CF03429A83009ACBEED587E37C561ED88A8695B22E71B8A21F2A2E1FFB
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/4'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  1939BE5355E6058DCCC13D4ABF7E30B54F3E0BD9
Password:  OF9DdKB7F5BMVA+N0GUBxtDA18tZuDr1YWrc/G49Eq8=
Private Key: 385F4374A07B17904C540F8DD06501C6D0C0D7CB59B83AF5616ADCFC6E3D12AF
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/5'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  D3AC7F79824E9883C7412D3745E5548271FB767C
Password:  kn4Ew/cG3Z6GPcKZZi4Pt0BPsZp/jm5up6wNl+J1eKE=
Private Key: 927E04C3F706DD9E863DC299662E0FB7404FB19A7F8E6E6EA7AC0D97E27578A1
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/6'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  974331C1F677D1658D8D6C0D2A233F78D89C8D2E
Password:  f8pz1fxICbXMje4OX0oJBWTTMDqR5jfHhRH4+gIkoH8=
Private Key: 7FCA73D5FC4809B5CC8DEE0E5F4A090564D3303A91E637C78511F8FA0224A07F
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/7'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  04EC8B3F4DBE044C8014D851C592F863BF4EC4F8
Password:  cAF9x4jnx4gf8QNOrwcYTTtohH9PS51qtl+K/CjCP3g=
Private Key: 70017DC788E7C7881FF1034EAF07184D3B68847F4F4B9D6AB65F8AFC28C23F78
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/8'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  C50CC893A4E9096E35C73A08A7AC561F367FF995
Password:  hXzMrPITbeFc0sQcxUknqftSZhD+rhNreZ91OGauIdA=
Private Key: 857CCCACF2136DE15CD2C41CC54927A9FB526610FEAE136B799F753866AE21D0
---------------------------------------------------------------
Mnemonic (24 words): aware present easily example nurse silver ecology plug accident decrease special ceiling federal sketch tackle twenty castle marine miss liquid dutch skate tide acoustic
BIP39 Path: m/44'/195'/9'
BIP39 Seed: 469c9422f2ec8a4197d57e2960d9ba578a2326676c0094c09deff347c546d19236195937f7585c843b95cca84498e64e98ef69133f7f7b31cb32be040a5ba22c
Address:  92C5AEC647880D19D9A4F654F06C483E8E3E33AB
Password:  pLpnfPkglS1UkYGVgiOGGxObNO8X9bvjTS4p6R2vASo=
Private Key: A4BA677CF920952D549181958223861B139B34EF17F5BBE34D2E29E91DAF012A
---------------------------------------------------------------

Reference

https://github.com/stellar/stellar-protocol/edit/master/ecosystem/sep-0005.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment