From 4c77015ed9c964603e193b31fb583b8adf31bea8 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 27 Jul 2018 16:01:14 +0200 Subject: [PATCH 01/18] protob: add combine makefile target for proto2js (which can't combine files by itself) --- protob/.gitignore | 1 + protob/Makefile | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/protob/.gitignore b/protob/.gitignore index 20e75334c..ee30dc04a 100644 --- a/protob/.gitignore +++ b/protob/.gitignore @@ -1,2 +1,3 @@ *.pb +combined.proto graph.gv* diff --git a/protob/Makefile b/protob/Makefile index e33b7b685..ece6846b9 100644 --- a/protob/Makefile +++ b/protob/Makefile @@ -3,5 +3,10 @@ check: messages.pb messages-bitcoin.pb messages-bootloader.pb messages-cardano.p %.pb: %.proto protoc -I/usr/include -I. $< -o $@ +combine: + echo 'syntax = "proto2";' > combined.proto + echo 'import "google/protobuf/descriptor.proto";' >> combined.proto + grep -hv -e '^import ' -e '^syntax' -e 'option java_' messages*.proto >> combined.proto + clean: rm -f *.pb From 279bc1f220d38db9562ac9e22d61c5b94a854f9f Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 29 Jul 2018 16:17:00 +0200 Subject: [PATCH 02/18] protob: add packages to proto files --- protob/Makefile | 2 +- protob/messages-bitcoin.proto | 7 ++++--- protob/messages-bootloader.proto | 1 + protob/messages-cardano.proto | 7 ++++--- protob/messages-common.proto | 1 + protob/messages-crypto.proto | 1 + protob/messages-debug.proto | 23 ++++++++++++----------- protob/messages-ethereum.proto | 1 + protob/messages-lisk.proto | 1 + protob/messages-management.proto | 17 +++++++++-------- protob/messages-monero.proto | 1 + protob/messages-nem.proto | 1 + protob/messages-ripple.proto | 1 + protob/messages-stellar.proto | 1 + protob/messages-tezos.proto | 1 + protob/messages.proto | 1 + 16 files changed, 41 insertions(+), 26 deletions(-) diff --git a/protob/Makefile b/protob/Makefile index ece6846b9..4168b783a 100644 --- a/protob/Makefile +++ b/protob/Makefile @@ -6,7 +6,7 @@ check: messages.pb messages-bitcoin.pb messages-bootloader.pb messages-cardano.p combine: echo 'syntax = "proto2";' > combined.proto echo 'import "google/protobuf/descriptor.proto";' >> combined.proto - grep -hv -e '^import ' -e '^syntax' -e 'option java_' messages*.proto >> combined.proto + grep -hv -e '^import ' -e '^syntax' -e '^package' -e 'option java_' messages*.proto | sed 's/hw\.trezor\.messages\.common\.//' >> combined.proto clean: rm -f *.pb diff --git a/protob/messages-bitcoin.proto b/protob/messages-bitcoin.proto index cd1d73062..09173edf7 100644 --- a/protob/messages-bitcoin.proto +++ b/protob/messages-bitcoin.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.bitcoin; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; @@ -29,8 +30,8 @@ message MultisigRedeemScriptType { * Structure representing HDNode + Path */ message HDNodePathType { - required HDNodeType node = 1; // BIP-32 node in deserialized form - repeated uint32 address_n = 2; // BIP-32 path to derive the key from node + required hw.trezor.messages.common.HDNodeType node = 1; // BIP-32 node in deserialized form + repeated uint32 address_n = 2; // BIP-32 path to derive the key from node } } @@ -53,7 +54,7 @@ message GetPublicKey { * @end */ message PublicKey { - required HDNodeType node = 1; // BIP32 public node + required hw.trezor.messages.common.HDNodeType node = 1; // BIP32 public node optional string xpub = 2; // serialized form of public node } diff --git a/protob/messages-bootloader.proto b/protob/messages-bootloader.proto index d05a7de3f..7151a8e3b 100644 --- a/protob/messages-bootloader.proto +++ b/protob/messages-bootloader.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.bootloader; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-cardano.proto b/protob/messages-cardano.proto index b0a2c4a47..8962210f4 100644 --- a/protob/messages-cardano.proto +++ b/protob/messages-cardano.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.cardano; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; @@ -40,9 +41,9 @@ message CardanoGetPublicKey { * @end */ message CardanoPublicKey { - optional string xpub = 1; // Xpub key - optional HDNodeType node = 2; // BIP-32 public node - optional string root_hd_passphrase = 3; // HD passphrase for root in hex format + optional string xpub = 1; // Xpub key + optional hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 public node + optional string root_hd_passphrase = 3; // HD passphrase for root in hex format } /** diff --git a/protob/messages-common.proto b/protob/messages-common.proto index 76bbb1fa2..9f3f0763a 100644 --- a/protob/messages-common.proto +++ b/protob/messages-common.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.common; /** * Response: Success of the previous request diff --git a/protob/messages-crypto.proto b/protob/messages-crypto.proto index d1f399911..8841fbc6b 100644 --- a/protob/messages-crypto.proto +++ b/protob/messages-crypto.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.crypto; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-debug.proto b/protob/messages-debug.proto index 3ae81c7d1..6c6e415a2 100644 --- a/protob/messages-debug.proto +++ b/protob/messages-debug.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.debug; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; @@ -30,17 +31,17 @@ message DebugLinkGetState { * @end */ message DebugLinkState { - optional bytes layout = 1; // raw buffer of display - optional string pin = 2; // current PIN, blank if PIN is not set/enabled - optional string matrix = 3; // current PIN matrix - optional string mnemonic = 4; // current BIP-39 mnemonic - optional HDNodeType node = 5; // current BIP-32 node - optional bool passphrase_protection = 6; // is node/mnemonic encrypted using passphrase? - optional string reset_word = 7; // word on device display during ResetDevice workflow - optional bytes reset_entropy = 8; // current entropy during ResetDevice workflow - optional string recovery_fake_word = 9; // (fake) word on display during RecoveryDevice workflow - optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting during RecoveryDevice workflow - optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow + optional bytes layout = 1; // raw buffer of display + optional string pin = 2; // current PIN, blank if PIN is not set/enabled + optional string matrix = 3; // current PIN matrix + optional string mnemonic = 4; // current BIP-39 mnemonic + optional hw.trezor.messages.common.HDNodeType node = 5; // current BIP-32 node + optional bool passphrase_protection = 6; // is node/mnemonic encrypted using passphrase? + optional string reset_word = 7; // word on device display during ResetDevice workflow + optional bytes reset_entropy = 8; // current entropy during ResetDevice workflow + optional string recovery_fake_word = 9; // (fake) word on display during RecoveryDevice workflow + optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting during RecoveryDevice workflow + optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow } /** diff --git a/protob/messages-ethereum.proto b/protob/messages-ethereum.proto index 559a7a220..d059c14b8 100644 --- a/protob/messages-ethereum.proto +++ b/protob/messages-ethereum.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.ethereum; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-lisk.proto b/protob/messages-lisk.proto index b66779a1d..ceeb26c9b 100644 --- a/protob/messages-lisk.proto +++ b/protob/messages-lisk.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.lisk; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-management.proto b/protob/messages-management.proto index 5300cd2f3..cffcbfb29 100644 --- a/protob/messages-management.proto +++ b/protob/messages-management.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.management; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; @@ -162,14 +163,14 @@ message WipeDevice { * @next Failure */ message LoadDevice { - optional string mnemonic = 1; // seed encoded as BIP-39 mnemonic (12, 18 or 24 words) - optional HDNodeType node = 2; // BIP-32 node - optional string pin = 3; // set PIN protection - optional bool passphrase_protection = 4; // enable master node encryption using passphrase - optional string language = 5 [default='english']; // device language - optional string label = 6; // device label - optional bool skip_checksum = 7; // do not test mnemonic for valid BIP-39 checksum - optional uint32 u2f_counter = 8; // U2F counter + optional string mnemonic = 1; // seed encoded as BIP-39 mnemonic (12, 18 or 24 words) + optional hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 node + optional string pin = 3; // set PIN protection + optional bool passphrase_protection = 4; // enable master node encryption using passphrase + optional string language = 5 [default='english']; // device language + optional string label = 6; // device label + optional bool skip_checksum = 7; // do not test mnemonic for valid BIP-39 checksum + optional uint32 u2f_counter = 8; // U2F counter } /** diff --git a/protob/messages-monero.proto b/protob/messages-monero.proto index 623a180c4..4aceafa25 100644 --- a/protob/messages-monero.proto +++ b/protob/messages-monero.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.monero; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-nem.proto b/protob/messages-nem.proto index 62428699f..295f9dcdb 100644 --- a/protob/messages-nem.proto +++ b/protob/messages-nem.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.nem; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-ripple.proto b/protob/messages-ripple.proto index 47909c1a8..5d13c909e 100644 --- a/protob/messages-ripple.proto +++ b/protob/messages-ripple.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.ripple; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-stellar.proto b/protob/messages-stellar.proto index 21a8ae7f5..b23e25ab0 100644 --- a/protob/messages-stellar.proto +++ b/protob/messages-stellar.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.stellar; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages-tezos.proto b/protob/messages-tezos.proto index d1ead31a4..091a354c2 100644 --- a/protob/messages-tezos.proto +++ b/protob/messages-tezos.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages.tezos; // Sugar for easier handling in Java option java_package = "com.satoshilabs.trezor.lib.protobuf"; diff --git a/protob/messages.proto b/protob/messages.proto index ef794e855..ff5171f43 100644 --- a/protob/messages.proto +++ b/protob/messages.proto @@ -1,4 +1,5 @@ syntax = "proto2"; +package hw.trezor.messages; /** * Messages for TREZOR communication From a3e7f2651ef3d85269074b43c9b85ff025b7ecf7 Mon Sep 17 00:00:00 2001 From: Michael Ira Krufky Date: Mon, 30 Jul 2018 05:59:42 -0400 Subject: [PATCH 03/18] eth: add Musicoin (#182) --- defs/ethereum/networks.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/defs/ethereum/networks.json b/defs/ethereum/networks.json index 39be85bf1..79c5b5889 100644 --- a/defs/ethereum/networks.json +++ b/defs/ethereum/networks.json @@ -142,5 +142,13 @@ "name": "Akroma", "rskip60": false, "url": "https://akroma.io" + }, + { + "chain_id": 7762959, + "slip44": 184, + "shortcut": "MUSIC", + "name": "Musicoin", + "rskip60": false, + "url": "https://musicoin.org" } ] From b6549f22cfda0b7fbb08ad5de7e837e2639a6016 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 30 Jul 2018 12:08:52 +0200 Subject: [PATCH 04/18] defs: fix coindef.py --- tools/coindef.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/coindef.py b/tools/coindef.py index 6ac4c0ecc..cc658bd2d 100644 --- a/tools/coindef.py +++ b/tools/coindef.py @@ -35,6 +35,7 @@ class CoinDef(p.MessageType): 30: ('maintainer', p.UnicodeType, 0), 31: ('blocktime_seconds', p.UVarintType, 0), 32: ('bip115', p.BoolType, 0), + 33: ('cooldown', p.UVarintType, 0), } def __init__( @@ -73,7 +74,8 @@ class CoinDef(p.MessageType): blocktime_seconds: int = None, default_fee_b: dict = None, bitcore: dict = None, - blockbook: dict = None + blockbook: dict = None, + cooldown: int = None ): self.coin_name = coin_name self.coin_shortcut = coin_shortcut @@ -110,4 +112,5 @@ class CoinDef(p.MessageType): self.default_fee_b = default_fee_b self.bitcore = bitcore self.blockbook = blockbook + self.cooldown = cooldown p.MessageType.__init__(self) From 621e8ded4523c403912fa1ef3e24290cd13ad5c1 Mon Sep 17 00:00:00 2001 From: leoreinaux Date: Tue, 31 Jul 2018 10:07:43 -0300 Subject: [PATCH 05/18] defs: add SmartCash (#183) --- defs/coins/smartcash.json | 44 ++++++++++++++++++++++++++++++ defs/coins/smartcash.png | Bin 0 -> 3330 bytes defs/coins/smartcash_testnet.json | 42 ++++++++++++++++++++++++++++ defs/coins/smartcash_testnet.png | Bin 0 -> 3136 bytes 4 files changed, 86 insertions(+) create mode 100644 defs/coins/smartcash.json create mode 100644 defs/coins/smartcash.png create mode 100644 defs/coins/smartcash_testnet.json create mode 100644 defs/coins/smartcash_testnet.png diff --git a/defs/coins/smartcash.json b/defs/coins/smartcash.json new file mode 100644 index 000000000..733f283c6 --- /dev/null +++ b/defs/coins/smartcash.json @@ -0,0 +1,44 @@ +{ + "coin_name": "SmartCash", + "coin_shortcut": "SMART", + "coin_label": "SmartCash", + "website": "https://smarcash.cc", + "github": "https://github.com/SmartCash/Core-Smart", + "maintainer": "Leandro Reinaux ", + "curve_name": "secp256k1", + "address_type": 63, + "address_type_p2sh": 18, + "maxfee_kb": 1000000, + "minfee_kb": 0, + "signed_message_header": "SmartCash Signed Message:\n", + "hash_genesis_block": "000007acc6970b812948d14ea5a0a13db0fdd07d5047c7e69101fa8b361e05a4", + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "bech32_prefix": null, + "cashaddr_prefix": null, + "slip44": 224, + "segwit": false, + "decred": false, + "fork_id": null, + "force_bip143": false, + "bip115": false, + "version_group_id": null, + "default_fee_b": { + "Low": 1, + "Economy": 10, + "Normal": 100, + "High": 200 + }, + "dust_limit": 546, + "blocktime_seconds": 55, + "uri_prefix": "smart", + "min_address_length": 27, + "max_address_length": 34, + "bitcore": [ + "https://insight.smartcash.cc" + ], + "blockbook": [], + "cooldown": 100 +} diff --git a/defs/coins/smartcash.png b/defs/coins/smartcash.png new file mode 100644 index 0000000000000000000000000000000000000000..e8a974e6ea5b8675c9f22fca175b2e5cd28e02d0 GIT binary patch literal 3330 zcmV+d4gKPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D43|knK~#8N?VSm9 z6jc_6|LQ#<0m2|6$Qeb!QQSq@R5XG*GlGBw5k^tN9(E82I{^a95>^AU$vA=-7$+ji z7)4MN9Po_5$be_YWyB3I31sc1y5`FL7uWlhm zj2KZ&ec#_05ynLNJ?V4O*Q7s?Vnm2`q^%_79DPW-f)pc6Tt>T~Zq91j%pc4!4<=+=X$<$7|!2W{st)4q%m&29RQefJAzLw1?z3?qx}mGG~Zg zDcO~vD0>tAS~1a~IBWqzadM~WfHt)z7%FG)3Ky+lbF-Pfj^d^gbWRplWKe$0BV z6Ik0wNhHI;N12gmKpIXOO{&KoOsBidn44xt>y~C;&&4@*+>7ChoXFej@%8wbPnt+# z#~K2oI3S+XgEWuSlslL^TA4BWaVz?Cwg$DM?;h}=@3eB9D&UjA&uP*S(k8W~Ge&Sg zN76J>vf3h&>Pi^d+ol@7ZhYvwn6<@)@r#}C$i9vW4w9ZB{Znn}gq{w#hBSi2GaNOx zB#^Nmf6#)A0d_QLpzW@exPZaWm*X#QyL~-=UL_4Bol#p6Mh^#Y`d}DotnahR{jJTI zPKNJzbM4}MupIivi-DQt`1Ek#=|J#VIIH4g;M&x^JytojD5m}`gQa;5eeGt zoIkrTHQNa#zz_J8)Q9wy+6p7#{^gvT;W$5%6vrKOv4k%7Sn&KXJFafbIW_$`aauvz z!g6fMt2S+Yi8P8-rnbUBxE#Q-ol^l5NWb9@=APTlnDn#_58r9=^%#rK{^Ld8sbx4u z<3ts>F^056ZE1|w4&Xz&GifgAHtt}WHI^`(;`~UGjYk55vyNs;BNjMOQW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y22~Syh>gOK}TDLM|<4gxyG_Boq>7zq3GGB3F z$DV+k6i+32CdRQ|a2eRI4}OU=zig9ZhF_`OtxC!6^S{cL^}lTi%J_aZ#cmDw|2R#& zp5(9o9;5c$Li&v4H>e~*Suo13DErPDz926_nU`i)lIm7_v-Srh|4Tw+1kV#Bp0W6i zd-atjW!vI7Wyi8O<)#*bKLAJoW1m>vT>t<8 M07*qoM6N<$f{ycH^Z)<= literal 0 HcmV?d00001 diff --git a/defs/coins/smartcash_testnet.json b/defs/coins/smartcash_testnet.json new file mode 100644 index 000000000..632562ae7 --- /dev/null +++ b/defs/coins/smartcash_testnet.json @@ -0,0 +1,42 @@ +{ + "coin_name": "SmartCash Testnet", + "coin_shortcut": "tSMART", + "coin_label": "SmartCash Testnet", + "website": "https://smartcash.cc", + "github": "https://github.com/SmartCash/Core-Smart", + "maintainer": "Leandro Reinaux ", + "curve_name": "secp256k1", + "address_type": 65, + "address_type_p2sh": 21, + "maxfee_kb": 1000000, + "minfee_kb": 0, + "signed_message_header": "SmartCash Signed Message:\n", + "hash_genesis_block": "0000027235b5679bcd28c90d03d4bf1a9ba4c07c4efcc1c87d6c68cce25e6e5d", + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "bech32_prefix": null, + "cashaddr_prefix": null, + "slip44": 224, + "segwit": false, + "decred": false, + "fork_id": null, + "force_bip143": false, + "bip115": false, + "version_group_id": null, + "default_fee_b": { + "Low": 1, + "Economy": 10, + "Normal": 100, + "High": 200 + }, + "dust_limit": 546, + "blocktime_seconds": 55, + "uri_prefix": "testsmart", + "min_address_length": 27, + "max_address_length": 35, + "bitcore": [], + "blockbook": [], + "cooldown": 100 +} diff --git a/defs/coins/smartcash_testnet.png b/defs/coins/smartcash_testnet.png new file mode 100644 index 0000000000000000000000000000000000000000..b6254426f43d219a11ab20747c4dbfcfdb2eb35a GIT binary patch literal 3136 zcmV-G48QYYBqAxfP_hKnQf;=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2tcf)^Ik&2F91+y>?`xiGwEi0{U&|Dtt}5zwrJvTf#fFuq)vE><|Rl|osyVHo=(K1 ziTUgIjrb7&sa#%%GAlMSppquu;~TB(I_hTt{s%e+IG$509a03K7RT6dxVsOih` a(*Feo86>RmFS_Rd0000 Date: Fri, 3 Aug 2018 18:57:43 +0200 Subject: [PATCH 06/18] protob: add one empty line to pb2py to make isort happy --- protob/pb2py | 1 + 1 file changed, 1 insertion(+) diff --git a/protob/pb2py b/protob/pb2py index 6323d7f37..7864229c8 100755 --- a/protob/pb2py +++ b/protob/pb2py @@ -215,6 +215,7 @@ class Descriptor: # "from .. import protobuf as p" yield self.protobuf_import + " as p" + yield "" fields = [self.parse_field(field) for field in message.field] From 3a7bdf684a64d3e1eb98a7f6eaa73d8f53b7f51a Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 3 Aug 2018 19:11:02 +0200 Subject: [PATCH 07/18] protob: make isort happy correctly --- protob/pb2py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/protob/pb2py b/protob/pb2py index 7864229c8..cf73456f8 100755 --- a/protob/pb2py +++ b/protob/pb2py @@ -189,6 +189,8 @@ class Descriptor: if field.orig.type == field.orig.TYPE_MESSAGE ) + if len(imports) > 0: + yield "" # make isort happy for name in sorted(imports): yield self.create_message_import(name) @@ -215,19 +217,19 @@ class Descriptor: # "from .. import protobuf as p" yield self.protobuf_import + " as p" - yield "" fields = [self.parse_field(field) for field in message.field] + yield from self.process_message_imports(fields) + if any(field.repeated for field in fields): + yield "" yield "if __debug__:" yield " try:" yield " from typing import List" yield " except ImportError:" yield " List = None # type: ignore" - yield from self.process_message_imports(fields) - yield "" yield "" yield "class {}(p.MessageType):".format(message.name) From 2e0aaf5cff12ae979d0a44a9ff17c0f6aa7d0cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=87=E5=B1=B1P?= Date: Mon, 6 Aug 2018 19:32:34 +0900 Subject: [PATCH 08/18] add monacoin's blockbook (#187) --- defs/coins/monacoin.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/defs/coins/monacoin.json b/defs/coins/monacoin.json index b23b30239..a0de87581 100644 --- a/defs/coins/monacoin.json +++ b/defs/coins/monacoin.json @@ -37,6 +37,8 @@ "https://mona.chainsight.info", "https://insight.electrum-mona.org" ], - "blockbook": [], + "blockbook": [ + "https://blockbook.electrum-mona.org" + ], "cooldown": 100 } From b6232410a8e642e7b825dd4902d39b4005c0a5fb Mon Sep 17 00:00:00 2001 From: Michael Ira Krufky Date: Mon, 6 Aug 2018 10:22:25 -0400 Subject: [PATCH 09/18] eth: add Ether-1 (ETHO) --- defs/ethereum/networks.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/defs/ethereum/networks.json b/defs/ethereum/networks.json index 79c5b5889..0535e136d 100644 --- a/defs/ethereum/networks.json +++ b/defs/ethereum/networks.json @@ -150,5 +150,13 @@ "name": "Musicoin", "rskip60": false, "url": "https://musicoin.org" + }, + { + "chain_id": 1313114, + "slip44": 1313114, + "shortcut": "ETHO", + "name": "Ether-1", + "rskip60": false, + "url": "https://ether1.org" } ] From b0059adf3f02cfd78c44183771813bce2913ed12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20B=C3=ADlek?= Date: Mon, 13 Aug 2018 22:01:23 +0700 Subject: [PATCH 10/18] Lowering dash minfee (#190) --- defs/coins/dash.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defs/coins/dash.json b/defs/coins/dash.json index 1b933a378..0c364ea7a 100644 --- a/defs/coins/dash.json +++ b/defs/coins/dash.json @@ -9,7 +9,7 @@ "address_type": 76, "address_type_p2sh": 16, "maxfee_kb": 100000, - "minfee_kb": 10000, + "minfee_kb": 1000, "signed_message_header": "DarkCoin Signed Message:\n", "hash_genesis_block": "00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6", "xprv_magic": 50221816, From 13f2f0042da3634ae31f4381cf522b22dec06210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Matejov?= Date: Mon, 13 Aug 2018 17:45:36 +0200 Subject: [PATCH 11/18] tezos: field updates and added reveal operation (#170) Signed-off-by: Adrian Matejov --- protob/messages-tezos.proto | 126 +++++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 53 deletions(-) diff --git a/protob/messages-tezos.proto b/protob/messages-tezos.proto index 091a354c2..2f954d4f0 100644 --- a/protob/messages-tezos.proto +++ b/protob/messages-tezos.proto @@ -5,6 +5,15 @@ package hw.trezor.messages.tezos; option java_package = "com.satoshilabs.trezor.lib.protobuf"; option java_outer_classname = "TrezorMessageTezos"; +/** + * Tezos Curve Type + */ +enum TezosCurveType { + Ed25519 = 0; + Secp256k1 = 1; + P256 = 2; +} + /** * Request: Ask device for Tezos address corresponding to address_n path * @start @@ -13,7 +22,8 @@ option java_outer_classname = "TrezorMessageTezos"; */ message TezosGetAddress { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node - optional bool show_display = 2; // optionally show on display before sending the result + optional TezosCurveType curve = 2 [default=Ed25519]; // Curve to use in trezor + optional bool show_display = 3; // optionally show on display before sending the result } /** @@ -31,7 +41,8 @@ message TezosAddress { */ message TezosGetPublicKey { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node - optional bool show_display = 2; // Optionally show on display before sending the result + optional TezosCurveType curve = 2 [default=Ed25519]; // Curve to use in trezor + optional bool show_display = 3; // Optionally show on display before sending the result } /** @@ -39,7 +50,7 @@ message TezosGetPublicKey { * @end */ message TezosPublicKey { - optional bytes public_key = 1; // Tezos public key + optional string public_key = 1; // b58 encoded Tezos public key with prefix } /** @@ -49,68 +60,77 @@ message TezosPublicKey { */ message TezosSignTx { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node - optional TezosOperationCommon operation = 2; // Tezos operation structure - optional TezosTransactionType transaction = 3; // Tezos transaction part - optional TezosOriginationType origination = 4; // Tezos origination part - optional TezosDelegationType delegation = 5; // Tezos delegation part + optional TezosCurveType curve = 2 [default=Ed25519]; // Curve to use in trezor + optional bytes branch = 3; // b58 encoded branch with prefix + + optional TezosRevealOp reveal = 4; // Tezos reveal operation (may be bundled with other op) + optional TezosTransactionOp transaction = 5; // Tezos transaction operation + optional TezosOriginationOp origination = 6; // Tezos origination operation + optional TezosDelegationOp delegation = 7; // Tezos delegation operation /* - * Tezos contract ID - */ + * Tezos contract ID + */ message TezosContractID { optional TezosContractType tag = 1; optional bytes hash = 2; // Implicit = 21B, originated = 20B + 1B padding /* - * Type of Tezos Contract type - */ + * Type of Tezos Contract type + */ enum TezosContractType { Implicit = 0; Originated = 1; } } - /* - * Structure representing the common part for Tezos operations + /** + * Structure representing information for reveal */ - message TezosOperationCommon { - optional bytes branch = 1; - optional TezosOperationType tag = 2; - optional TezosContractID source = 3; - optional uint64 fee = 4; - optional uint64 counter = 5; - optional uint64 gas_limit = 6; - optional uint64 storage_limit = 7; - /* - * Type of Tezos operation - */ - enum TezosOperationType { - Transaction = 8; - Origination = 9; - Delegation = 10; - } + message TezosRevealOp { + optional TezosContractID source = 1; + optional uint64 fee = 2; + optional uint64 counter = 3; + optional uint64 gas_limit = 4; + optional uint64 storage_limit = 5; + optional bytes public_key = 6; } - /* - * Structure representing additional information for transaction + /** + * Structure representing information for transaction */ - message TezosTransactionType { - optional uint64 amount = 1; - optional TezosContractID destination = 2; - optional bytes parameters = 3; + message TezosTransactionOp { + optional TezosContractID source = 1; + optional uint64 fee = 2; + optional uint64 counter = 3; + optional uint64 gas_limit = 4; + optional uint64 storage_limit = 5; + optional uint64 amount = 6; + optional TezosContractID destination = 7; + optional bytes parameters = 8; } - /* - * Structure representing additional information for origination - */ - message TezosOriginationType { - optional bytes manager_pubkey = 1; - optional uint64 balance = 2; - optional bool spendable = 3; - optional bool delegatable = 4; - optional bytes delegate = 5; // 1B tag + 20B public key hash - optional bytes script = 6; + /** + * Structure representing information for origination + */ + message TezosOriginationOp { + optional TezosContractID source = 1; + optional uint64 fee = 2; + optional uint64 counter = 3; + optional uint64 gas_limit = 4; + optional uint64 storage_limit = 5; + optional bytes manager_pubkey = 6; + optional uint64 balance = 7; + optional bool spendable = 8; + optional bool delegatable = 9; + optional bytes delegate = 10; + optional bytes script = 11; } - /* - * Structure representing additional information for delegation - */ - message TezosDelegationType { - optional bytes delegate = 1; // 1B tag + 20B public key hash + /** + * Structure representing information for delegation + */ + message TezosDelegationOp { + optional TezosContractID source = 1; + optional uint64 fee = 2; + optional uint64 counter = 3; + optional uint64 gas_limit = 4; + optional uint64 storage_limit = 5; + optional bytes delegate = 6; } } @@ -119,7 +139,7 @@ message TezosSignTx { * @end */ message TezosSignedTx { - optional bytes signature = 1; // Tezos transaction signature - optional bytes sig_op_contents = 2; // Signed operation contents - optional string operation_hash = 3; // b58 check encoded blake2b hashed operation contents + optional string signature = 1; // Tezos b58 encoded transaction signature with prefix + optional bytes sig_op_contents = 2; // operation_bytes + signed operation_bytes + optional string operation_hash = 3; // b58 encoded hashed operation contents with prefix } From 18739987ee2884e74c0a0fccdd29a7d941ec1281 Mon Sep 17 00:00:00 2001 From: Matus Zamborsky Date: Tue, 14 Aug 2018 15:23:07 +0200 Subject: [PATCH 12/18] protob: Add Ontology support (#184) --- protob/Makefile | 2 +- protob/messages-ontology.proto | 198 +++++++++++++++++++++++++++++++++ protob/messages.proto | 12 ++ 3 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 protob/messages-ontology.proto diff --git a/protob/Makefile b/protob/Makefile index 4168b783a..74d2e3339 100644 --- a/protob/Makefile +++ b/protob/Makefile @@ -1,4 +1,4 @@ -check: messages.pb messages-bitcoin.pb messages-bootloader.pb messages-cardano.pb messages-common.pb messages-crypto.pb messages-debug.pb messages-ethereum.pb messages-lisk.pb messages-management.pb messages-monero.pb messages-nem.pb messages-ripple.pb messages-stellar.pb messages-tezos.pb +check: messages.pb messages-bitcoin.pb messages-bootloader.pb messages-cardano.pb messages-common.pb messages-crypto.pb messages-debug.pb messages-ethereum.pb messages-lisk.pb messages-management.pb messages-monero.pb messages-nem.pb messages-ripple.pb messages-stellar.pb messages-tezos.pb messages-ontology.pb %.pb: %.proto protoc -I/usr/include -I. $< -o $@ diff --git a/protob/messages-ontology.proto b/protob/messages-ontology.proto new file mode 100644 index 000000000..338d5ce38 --- /dev/null +++ b/protob/messages-ontology.proto @@ -0,0 +1,198 @@ +syntax = "proto2"; + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessageOntology"; + +/** +* Ontology Transaction +*/ +message OntologyTransaction { + + /** + * Attribute of Ontology transaction + */ + message OntologyTxAttribute { + optional uint32 usage = 1; + optional bytes data = 2; + } + + optional uint32 version = 1; + optional uint32 type = 2; + optional uint32 nonce = 3; + optional uint64 gas_price = 4; + optional uint64 gas_limit = 5; + optional string payer = 6; + repeated OntologyTxAttribute tx_attributes = 7; +} + +/** + * Request: Ask device for Ontology public key corresponding to address_n path + * @start + * @next OntologyPublicKey +*/ +message OntologyGetPublicKey { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional bool show_display = 2; // Optionally show on display before sending the result +} + +/** + * Response: Contains Ontology public key derived from device private seed + * @end +*/ +message OntologyPublicKey { + optional bytes public_key = 1; // Ontology public key +} + +/** + * Request: Ask device for Ontology address corresponding to address_n path + * @start + * @next OntologyAddress + */ +message OntologyGetAddress { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional bool show_display = 2; // Optionally show on display before sending the result +} + +/** + * Response: Contains Ontology address derived from device private seed + * @end + */ +message OntologyAddress { + optional string address = 1; // Ontology address +} + + +/** + * Request: Ask device to sign Ontology transfer + * @start + * @next OntologySignedTransfer + */ + message OntologySignTransfer { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional OntologyTransaction transaction = 2; + optional OntologyTransfer transfer = 3; + + /** + * Ontology Transfer + */ + message OntologyTransfer { + /** + * Ontology Asset + */ + enum OntologyAsset { + ONT = 1; + ONG = 2; + } + + optional OntologyAsset asset = 1; + optional uint64 amount = 2; + optional string from_address = 3; + optional string to_address = 4; + } +} + +/** +* Response: Contains Ontology transfer signature +* @end +*/ +message OntologySignedTransfer { + optional bytes signature = 1; + optional bytes payload = 2; +} + +/** + * Request: Ask device to sign Ontology ONG withdrawal + * @start + * @next OntologySignedWithdrawOng + */ + message OntologySignWithdrawOng { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional OntologyTransaction transaction = 2; + optional OntologyWithdrawOng withdraw_ong = 3; + + /** + * Ontology ONG Withdrawal + */ + message OntologyWithdrawOng { + optional uint64 amount = 1; + optional string from_address = 2; + optional string to_address = 3; + } +} + +/** +* Response: Contains Ontology ONG withdrawal signature +* @end +*/ +message OntologySignedWithdrawOng { + optional bytes signature = 1; + optional bytes payload = 2; +} + +/** + * Request: Ask device to sign Ontology ONT ID registration + * @start + * @next OntologySignedOntIdRegister + */ + message OntologySignOntIdRegister { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional OntologyTransaction transaction = 2; + optional OntologyOntIdRegister ont_id_register = 3; + + /** + * Ontology ONT ID registration + */ + message OntologyOntIdRegister { + optional string ont_id = 1; + optional bytes public_key = 2; + } +} + +/** +* Response: Contains Ontology ONT ID registration signature +* @end +*/ +message OntologySignedOntIdRegister { + optional bytes signature = 1; + optional bytes payload = 2; +} + + +/** + * Request: Ask device to sign Ontology ONT ID attributes adding + * @start + * @next OntologySignedOntIdAddAttributes + */ + message OntologySignOntIdAddAttributes { + repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node + optional OntologyTransaction transaction = 2; + optional OntologyOntIdAddAttributes ont_id_add_attributes = 3; + + /** + * Attribute of Ontology ONT ID + */ + message OntologyOntIdAttribute { + optional string key = 1; + optional string type = 2; + optional string value = 3; + } + + /** + * Ontology ONT ID attributes adding + */ + message OntologyOntIdAddAttributes { + optional string ont_id = 1; + optional bytes public_key = 2; + repeated OntologyOntIdAttribute ont_id_attributes = 3; + } +} + +/** +* Response: Contains Ontology ONT ID attributes adding signature +* @end +*/ +message OntologySignedOntIdAddAttributes { + optional bytes signature = 1; + optional bytes payload = 2; +} diff --git a/protob/messages.proto b/protob/messages.proto index ff5171f43..05536de10 100644 --- a/protob/messages.proto +++ b/protob/messages.proto @@ -174,6 +174,18 @@ enum MessageType { MessageType_CardanoTxAck = 309 [(wire_in) = true]; MessageType_CardanoSignedTransaction = 310 [(wire_out) = true]; + // Ontology + MessageType_OntologyGetAddress = 350 [(wire_in) = true]; + MessageType_OntologyAddress = 351 [(wire_out) = true]; + MessageType_OntologyGetPublicKey = 352 [(wire_in) = true]; + MessageType_OntologyPublicKey = 353 [(wire_out) = true]; + MessageType_OntologySignTx = 354 [(wire_in) = true]; + MessageType_OntologySignedTx = 355 [(wire_out) = true]; + MessageType_OntologySignTransfer = 356 [(wire_in) = true]; + MessageType_OntologySignedTransfer = 357 [(wire_out) = true]; + MessageType_OntologySignWithdrawOng = 358 [(wire_in) = true]; + MessageType_OntologySignedWithdrawOng = 359 [(wire_out) = true]; + // Ripple MessageType_RippleGetAddress = 400 [(wire_in) = true]; MessageType_RippleAddress = 401 [(wire_out) = true]; From 390b0272e8749a528bbfda5d5c7ad1f3e6a5e8ae Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 14 Aug 2018 15:25:42 +0200 Subject: [PATCH 13/18] protob: reorder Ontology messages/fields --- protob/messages-ontology.proto | 48 ++++++++++++++-------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/protob/messages-ontology.proto b/protob/messages-ontology.proto index 338d5ce38..5e1e406f7 100644 --- a/protob/messages-ontology.proto +++ b/protob/messages-ontology.proto @@ -8,15 +8,6 @@ option java_outer_classname = "TrezorMessageOntology"; * Ontology Transaction */ message OntologyTransaction { - - /** - * Attribute of Ontology transaction - */ - message OntologyTxAttribute { - optional uint32 usage = 1; - optional bytes data = 2; - } - optional uint32 version = 1; optional uint32 type = 2; optional uint32 nonce = 3; @@ -24,6 +15,13 @@ message OntologyTransaction { optional uint64 gas_limit = 5; optional string payer = 6; repeated OntologyTxAttribute tx_attributes = 7; + /** + * Attribute of Ontology transaction + */ + message OntologyTxAttribute { + optional uint32 usage = 1; + optional bytes data = 2; + } } /** @@ -62,7 +60,6 @@ message OntologyAddress { optional string address = 1; // Ontology address } - /** * Request: Ask device to sign Ontology transfer * @start @@ -72,11 +69,14 @@ message OntologyAddress { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyTransfer transfer = 3; - /** * Ontology Transfer */ message OntologyTransfer { + optional OntologyAsset asset = 1; + optional uint64 amount = 2; + optional string from_address = 3; + optional string to_address = 4; /** * Ontology Asset */ @@ -84,11 +84,6 @@ message OntologyAddress { ONT = 1; ONG = 2; } - - optional OntologyAsset asset = 1; - optional uint64 amount = 2; - optional string from_address = 3; - optional string to_address = 4; } } @@ -110,7 +105,6 @@ message OntologySignedTransfer { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyWithdrawOng withdraw_ong = 3; - /** * Ontology ONG Withdrawal */ @@ -139,7 +133,6 @@ message OntologySignedWithdrawOng { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyOntIdRegister ont_id_register = 3; - /** * Ontology ONT ID registration */ @@ -158,7 +151,6 @@ message OntologySignedOntIdRegister { optional bytes payload = 2; } - /** * Request: Ask device to sign Ontology ONT ID attributes adding * @start @@ -168,16 +160,6 @@ message OntologySignedOntIdRegister { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyOntIdAddAttributes ont_id_add_attributes = 3; - - /** - * Attribute of Ontology ONT ID - */ - message OntologyOntIdAttribute { - optional string key = 1; - optional string type = 2; - optional string value = 3; - } - /** * Ontology ONT ID attributes adding */ @@ -185,6 +167,14 @@ message OntologySignedOntIdRegister { optional string ont_id = 1; optional bytes public_key = 2; repeated OntologyOntIdAttribute ont_id_attributes = 3; + /** + * Attribute of Ontology ONT ID + */ + message OntologyOntIdAttribute { + optional string key = 1; + optional string type = 2; + optional string value = 3; + } } } From a6a53441f559b1eb67f91a37c56211a07cc21f62 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 14 Aug 2018 20:53:02 +0200 Subject: [PATCH 14/18] protob: fix Ontology message ids (closes #191) --- protob/messages.proto | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/protob/messages.proto b/protob/messages.proto index 05536de10..d93efb02c 100644 --- a/protob/messages.proto +++ b/protob/messages.proto @@ -179,12 +179,14 @@ enum MessageType { MessageType_OntologyAddress = 351 [(wire_out) = true]; MessageType_OntologyGetPublicKey = 352 [(wire_in) = true]; MessageType_OntologyPublicKey = 353 [(wire_out) = true]; - MessageType_OntologySignTx = 354 [(wire_in) = true]; - MessageType_OntologySignedTx = 355 [(wire_out) = true]; - MessageType_OntologySignTransfer = 356 [(wire_in) = true]; - MessageType_OntologySignedTransfer = 357 [(wire_out) = true]; - MessageType_OntologySignWithdrawOng = 358 [(wire_in) = true]; - MessageType_OntologySignedWithdrawOng = 359 [(wire_out) = true]; + MessageType_OntologySignTransfer = 354 [(wire_in) = true]; + MessageType_OntologySignedTransfer = 355 [(wire_out) = true]; + MessageType_OntologySignWithdrawOng = 356 [(wire_in) = true]; + MessageType_OntologySignedWithdrawOng = 357 [(wire_out) = true]; + MessageType_OntologySignOntIdRegister = 358 [(wire_in) = true]; + MessageType_OntologySignedOntIdRegister = 359 [(wire_out) = true]; + MessageType_OntologySignOntIdAddAttributes = 360 [(wire_in) = true]; + MessageType_OntologySignedOntIdAddAttributes = 361 [(wire_out) = true]; // Ripple MessageType_RippleGetAddress = 400 [(wire_in) = true]; From d3989c68d68caedefa3018f28fd2b90c612eadec Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 14 Aug 2018 20:59:00 +0200 Subject: [PATCH 15/18] protob: fix whitespace in Ontology messages --- protob/messages-ontology.proto | 65 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/protob/messages-ontology.proto b/protob/messages-ontology.proto index 5e1e406f7..cac05cd8e 100644 --- a/protob/messages-ontology.proto +++ b/protob/messages-ontology.proto @@ -5,8 +5,9 @@ option java_package = "com.satoshilabs.trezor.lib.protobuf"; option java_outer_classname = "TrezorMessageOntology"; /** -* Ontology Transaction -*/ + * Ontology Transaction + * @embed + */ message OntologyTransaction { optional uint32 version = 1; optional uint32 type = 2; @@ -16,8 +17,8 @@ message OntologyTransaction { optional string payer = 6; repeated OntologyTxAttribute tx_attributes = 7; /** - * Attribute of Ontology transaction - */ + * Attribute of Ontology transaction + */ message OntologyTxAttribute { optional uint32 usage = 1; optional bytes data = 2; @@ -28,7 +29,7 @@ message OntologyTransaction { * Request: Ask device for Ontology public key corresponding to address_n path * @start * @next OntologyPublicKey -*/ + */ message OntologyGetPublicKey { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional bool show_display = 2; // Optionally show on display before sending the result @@ -37,7 +38,7 @@ message OntologyGetPublicKey { /** * Response: Contains Ontology public key derived from device private seed * @end -*/ + */ message OntologyPublicKey { optional bytes public_key = 1; // Ontology public key } @@ -65,21 +66,21 @@ message OntologyAddress { * @start * @next OntologySignedTransfer */ - message OntologySignTransfer { +message OntologySignTransfer { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyTransfer transfer = 3; /** - * Ontology Transfer - */ + * Ontology Transfer + */ message OntologyTransfer { optional OntologyAsset asset = 1; optional uint64 amount = 2; optional string from_address = 3; optional string to_address = 4; /** - * Ontology Asset - */ + * Ontology Asset + */ enum OntologyAsset { ONT = 1; ONG = 2; @@ -88,9 +89,9 @@ message OntologyAddress { } /** -* Response: Contains Ontology transfer signature -* @end -*/ + * Response: Contains Ontology transfer signature + * @end + */ message OntologySignedTransfer { optional bytes signature = 1; optional bytes payload = 2; @@ -101,7 +102,7 @@ message OntologySignedTransfer { * @start * @next OntologySignedWithdrawOng */ - message OntologySignWithdrawOng { +message OntologySignWithdrawOng { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyWithdrawOng withdraw_ong = 3; @@ -116,9 +117,9 @@ message OntologySignedTransfer { } /** -* Response: Contains Ontology ONG withdrawal signature -* @end -*/ + * Response: Contains Ontology ONG withdrawal signature + * @end + */ message OntologySignedWithdrawOng { optional bytes signature = 1; optional bytes payload = 2; @@ -129,13 +130,13 @@ message OntologySignedWithdrawOng { * @start * @next OntologySignedOntIdRegister */ - message OntologySignOntIdRegister { +message OntologySignOntIdRegister { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyOntIdRegister ont_id_register = 3; /** - * Ontology ONT ID registration - */ + * Ontology ONT ID registration + */ message OntologyOntIdRegister { optional string ont_id = 1; optional bytes public_key = 2; @@ -143,9 +144,9 @@ message OntologySignedWithdrawOng { } /** -* Response: Contains Ontology ONT ID registration signature -* @end -*/ + * Response: Contains Ontology ONT ID registration signature + * @end + */ message OntologySignedOntIdRegister { optional bytes signature = 1; optional bytes payload = 2; @@ -156,20 +157,20 @@ message OntologySignedOntIdRegister { * @start * @next OntologySignedOntIdAddAttributes */ - message OntologySignOntIdAddAttributes { +message OntologySignOntIdAddAttributes { repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node optional OntologyTransaction transaction = 2; optional OntologyOntIdAddAttributes ont_id_add_attributes = 3; /** - * Ontology ONT ID attributes adding - */ + * Ontology ONT ID attributes adding + */ message OntologyOntIdAddAttributes { optional string ont_id = 1; optional bytes public_key = 2; repeated OntologyOntIdAttribute ont_id_attributes = 3; /** - * Attribute of Ontology ONT ID - */ + * Attribute of Ontology ONT ID + */ message OntologyOntIdAttribute { optional string key = 1; optional string type = 2; @@ -179,9 +180,9 @@ message OntologySignedOntIdRegister { } /** -* Response: Contains Ontology ONT ID attributes adding signature -* @end -*/ + * Response: Contains Ontology ONT ID attributes adding signature + * @end + */ message OntologySignedOntIdAddAttributes { optional bytes signature = 1; optional bytes payload = 2; From 3765399d9deaf51b0c1faa24aac5ae55581bd455 Mon Sep 17 00:00:00 2001 From: Michael Ira Krufky Date: Wed, 15 Aug 2018 05:29:29 -0400 Subject: [PATCH 16/18] eth: Add Pirl support (#193) --- defs/ethereum/networks.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/defs/ethereum/networks.json b/defs/ethereum/networks.json index 0535e136d..1210db1d7 100644 --- a/defs/ethereum/networks.json +++ b/defs/ethereum/networks.json @@ -158,5 +158,13 @@ "name": "Ether-1", "rskip60": false, "url": "https://ether1.org" + }, + { + "chain_id": 3125659152, + "slip44": 164, + "shortcut": "PIRL", + "name": "Pirl", + "rskip60": false, + "url": "https://pirl.io" } ] From 1ef050fb15030a1f0d210d31559c727e5a517404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Klinec?= Date: Wed, 15 Aug 2018 11:39:06 +0200 Subject: [PATCH 17/18] xmr: protob protocol improvements (#192) - uses protobuff messages only for the transaction construction data - forward compatible. Not stable on Monero side, serialization format of the cryptonote serialization could be changed in the future (new fields), CN serialization does not support versioning, thus it is not forward compatible. - MoneroTransactionDestinationEntry, MoneroTransactionSourceEntry have to be defined in the root level as they are used in various protocol messages --- protob/messages-monero.proto | 72 ++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/protob/messages-monero.proto b/protob/messages-monero.proto index 4aceafa25..189307dbf 100644 --- a/protob/messages-monero.proto +++ b/protob/messages-monero.proto @@ -47,6 +47,23 @@ message MoneroWatchKey { optional bytes address = 2; } +/** + * Structure representing Monero transaction destination entry + */ +message MoneroTransactionDestinationEntry { + optional uint64 amount = 1; + optional MoneroAccountPublicAddress addr = 2; + optional bool is_subaddress = 3; + + /** + * Structure representing Monero public address + */ + message MoneroAccountPublicAddress { + optional bytes spend_public_key = 1; + optional bytes view_public_key = 2; + } +} + /** * Request: Sub request of MoneroTransactionSign. Initializes transaction signing. * @start @@ -75,21 +92,6 @@ message MoneroTransactionInitRequest { optional bytes exp_tx_prefix_hash = 12; repeated bytes use_tx_keys = 13; optional bool is_bulletproof = 14; - /** - * Structure representing Monero transaction destination entry - */ - message MoneroTransactionDestinationEntry { - optional uint64 amount = 1; - optional MoneroAccountPublicAddress addr = 2; - optional bool is_subaddress = 3; - /** - * Structure representing Monero public address - */ - message MoneroAccountPublicAddress { - optional bytes spend_public_key = 1; - optional bytes view_public_key = 2; - } - } } } @@ -106,13 +108,45 @@ message MoneroTransactionInitAck { optional bool many_outputs = 6; } +/** + * Structure representing Monero transaction source entry, UTXO + */ +message MoneroTransactionSourceEntry { + repeated MoneroOutputEntry outputs = 1; + optional uint64 real_output = 2; + optional bytes real_out_tx_key = 3; + repeated bytes real_out_additional_tx_keys = 4; + optional uint64 real_output_in_tx_index = 5; + optional uint64 amount = 6; + optional bool rct = 7; + optional bytes mask = 8; + optional MoneroMultisigKLRki multisig_kLRki = 9; + + message MoneroRctKey { + optional bytes dest = 1; + optional bytes mask = 2; + } + + message MoneroOutputEntry { + optional uint64 idx = 1; + optional MoneroRctKey key = 2; + } + + message MoneroMultisigKLRki { + optional bytes K = 1; + optional bytes L = 2; + optional bytes R = 3; + optional bytes ki = 4; + } +} + /** * Request: Sub request of MoneroTransactionSign. Sends one UTXO to device * @next MoneroTransactionSetInputAck */ message MoneroTransactionSetInputRequest { optional uint32 version = 1; - optional bytes src_entr = 2; // xmrtypes.TxSourceEntry + optional MoneroTransactionSourceEntry src_entr = 2; } /** @@ -148,7 +182,7 @@ message MoneroTransactionInputsPermutationAck { * @next MoneroTransactionInputViniAck */ message MoneroTransactionInputViniRequest { - optional bytes src_entr = 1; // xmrtypes.TxSourceEntry + optional MoneroTransactionSourceEntry src_entr = 1; optional bytes vini = 2; // xmrtypes.TxinToKey optional bytes vini_hmac = 3; optional bytes pseudo_out = 4; @@ -167,7 +201,7 @@ message MoneroTransactionInputViniAck { * @next MoneroTransactionSetOutputAck */ message MoneroTransactionSetOutputRequest { - optional bytes dst_entr = 1; // xmrtypes.TxDestinationEntry + optional MoneroTransactionDestinationEntry dst_entr = 1; optional bytes dst_entr_hmac = 2; } @@ -228,7 +262,7 @@ message MoneroTransactionMlsagDoneAck { * @next MoneroTransactionSignInputAck */ message MoneroTransactionSignInputRequest { - optional bytes src_entr = 1; // xmrtypes.TxSourceEntry + optional MoneroTransactionSourceEntry src_entr = 1; optional bytes vini = 2; // xmrtypes.TxinToKey optional bytes vini_hmac = 3; optional bytes pseudo_out = 4; From 21b3cd435258facfd6c2f9008d7ad17636ac747c Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 15 Aug 2018 11:44:43 +0200 Subject: [PATCH 18/18] protob: fix whitespace and order in messages-monero.proto --- protob/messages-monero.proto | 116 +++++++++++++++++------------------ 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/protob/messages-monero.proto b/protob/messages-monero.proto index 189307dbf..f41fe9e14 100644 --- a/protob/messages-monero.proto +++ b/protob/messages-monero.proto @@ -5,6 +5,53 @@ package hw.trezor.messages.monero; option java_package = "com.satoshilabs.trezor.lib.protobuf"; option java_outer_classname = "TrezorMessageMonero"; +/** + * Structure representing Monero transaction source entry, UTXO + * @embed + */ +message MoneroTransactionSourceEntry { + repeated MoneroOutputEntry outputs = 1; + optional uint64 real_output = 2; + optional bytes real_out_tx_key = 3; + repeated bytes real_out_additional_tx_keys = 4; + optional uint64 real_output_in_tx_index = 5; + optional uint64 amount = 6; + optional bool rct = 7; + optional bytes mask = 8; + optional MoneroMultisigKLRki multisig_kLRki = 9; + message MoneroOutputEntry { + optional uint64 idx = 1; + optional MoneroRctKey key = 2; + message MoneroRctKey { + optional bytes dest = 1; + optional bytes mask = 2; + } + } + message MoneroMultisigKLRki { + optional bytes K = 1; + optional bytes L = 2; + optional bytes R = 3; + optional bytes ki = 4; + } +} + +/** + * Structure representing Monero transaction destination entry + * @embed + */ +message MoneroTransactionDestinationEntry { + optional uint64 amount = 1; + optional MoneroAccountPublicAddress addr = 2; + optional bool is_subaddress = 3; + /** + * Structure representing Monero public address + */ + message MoneroAccountPublicAddress { + optional bytes spend_public_key = 1; + optional bytes view_public_key = 2; + } +} + /** * Request: Ask device for public address derived from seed and address_n * @start @@ -47,23 +94,6 @@ message MoneroWatchKey { optional bytes address = 2; } -/** - * Structure representing Monero transaction destination entry - */ -message MoneroTransactionDestinationEntry { - optional uint64 amount = 1; - optional MoneroAccountPublicAddress addr = 2; - optional bool is_subaddress = 3; - - /** - * Structure representing Monero public address - */ - message MoneroAccountPublicAddress { - optional bytes spend_public_key = 1; - optional bytes view_public_key = 2; - } -} - /** * Request: Sub request of MoneroTransactionSign. Initializes transaction signing. * @start @@ -75,8 +105,8 @@ message MoneroTransactionInitRequest { optional uint32 network_type = 3; // Main-net / testnet / stagenet optional MoneroTransactionData tsx_data = 4; /** - * Structure representing Monero initial transaction information - */ + * Structure representing Monero initial transaction information + */ message MoneroTransactionData { optional uint32 version = 1; optional bytes payment_id = 2; @@ -108,38 +138,6 @@ message MoneroTransactionInitAck { optional bool many_outputs = 6; } -/** - * Structure representing Monero transaction source entry, UTXO - */ -message MoneroTransactionSourceEntry { - repeated MoneroOutputEntry outputs = 1; - optional uint64 real_output = 2; - optional bytes real_out_tx_key = 3; - repeated bytes real_out_additional_tx_keys = 4; - optional uint64 real_output_in_tx_index = 5; - optional uint64 amount = 6; - optional bool rct = 7; - optional bytes mask = 8; - optional MoneroMultisigKLRki multisig_kLRki = 9; - - message MoneroRctKey { - optional bytes dest = 1; - optional bytes mask = 2; - } - - message MoneroOutputEntry { - optional uint64 idx = 1; - optional MoneroRctKey key = 2; - } - - message MoneroMultisigKLRki { - optional bytes K = 1; - optional bytes L = 2; - optional bytes R = 3; - optional bytes ki = 4; - } -} - /** * Request: Sub request of MoneroTransactionSign. Sends one UTXO to device * @next MoneroTransactionSetInputAck @@ -233,8 +231,8 @@ message MoneroTransactionAllOutSetAck { optional bytes tx_prefix_hash = 2; optional MoneroRingCtSig rv = 3; // xmrtypes.RctSig /* - * Structure represents initial fields of the Monero RCT signature - */ + * Structure represents initial fields of the Monero RCT signature + */ message MoneroRingCtSig { optional uint64 txn_fee = 1; optional bytes message = 2; @@ -334,8 +332,8 @@ message MoneroKeyImageExportInitRequest { optional uint32 network_type = 4; // Main-net / testnet / stagenet repeated MoneroSubAddressIndicesList subs = 5; /** - * Structure representing Monero list of sub-addresses - */ + * Structure representing Monero list of sub-addresses + */ message MoneroSubAddressIndicesList { optional uint32 account = 1; repeated uint32 minor_indices = 2; @@ -356,8 +354,8 @@ message MoneroKeyImageExportInitAck { message MoneroKeyImageSyncStepRequest { repeated MoneroTransferDetails tdis = 1; /** - * Structure representing Monero UTXO for key image sync - */ + * Structure representing Monero UTXO for key image sync + */ message MoneroTransferDetails { optional bytes out_key = 1; optional bytes tx_pub_key = 2; @@ -373,8 +371,8 @@ message MoneroKeyImageSyncStepRequest { message MoneroKeyImageSyncStepAck { repeated MoneroExportedKeyImage kis = 1; /** - * Structure representing Monero encrypted exported key image - */ + * Structure representing Monero encrypted exported key image + */ message MoneroExportedKeyImage { optional bytes iv = 1; optional bytes tag = 2;