Author Topic: Wrong public key recovered from signature?  (Read 2048 times)

0 Members and 1 Guest are viewing this topic.


Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
BitShares committee member: abit
BitShares witness: in.abit

Offline zhangweis

  • Sr. Member
  • ****
  • Posts: 305
    • View Profile
I found strange BTS7wzHgbPEHouxuvM16rDGNo4d9CdYYLajS16y3uawoptKrKNXHE key in stack which doesn't have any relationship with my account. I checked the transaction.cpp code and seems it's a public key recovered from signature. Does it have relation with how the public key is recovered?
Stack:
message: 'missing required active authority: Missing Active Authority 1.2.681608',
data:
{ code: 3030001,
name: 'tx_missing_active_auth',
message: 'missing required active authority',
stack: [ [Object], [Object], [Object], [Object], [Object], [Object] ] } } {"code":1,"message":"missing required active authority: Missing Active Authority 1.2.681608","data":{"code":3030001,"name":"tx_missing_active_auth","message":"missing required active authority","stack":[{"context":{"level":"error","file":"transaction.cpp","line":282,"method":"verify_authority","hostname":"","thread_name":"th_a","timestamp":"2018-01-29T09:50:42"},"format":"Missing Active Authority ${id}","data":{"id":"1.2.681608","auth":{"weight_threshold":1,"account_auths":[],"key_auths":[["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1]],"address_auths":[]},"owner":{"weight_threshold":1,"account_auths":[],"key_auths":[["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1]],"address_auths":[]}}},{"context":{"level":"warn","file":"transaction.cpp","line":297,"method":"verify_authority","hostname":"","thread_name":"th_a","timestamp":"2018-01-29T09:50:42"},"format":"","data":{"ops":[[6,{"fee":{"amount":35,"asset_id":"1.3.113"},"account":"1.2.681608","owner":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"active":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"extensions":{}}]],"sigs":["BTS7wzHgbPEHouxuvM16rDGNo4d9CdYYLajS16y3uawoptKrKNXHE"]}},{"context":{"level":"warn","file":"transaction.cpp","line":384,"method":"verify_authority","hostname":"","thread_name":"th_a","timestamp":"2018-01-29T09:50:42"},"format":"","data":{"*this":{"ref_block_num":34312,"ref_block_prefix":4177447021,"expiration":"2018-01-30T09:09:08","operations":[[6,{"fee":{"amount":35,"asset_id":"1.3.113"},"account":"1.2.681608","owner":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"active":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"extensions":{}}]],"extensions":[],"signatures":["200ad525ede016109cf8179a3b61cd73be43028f45ef06a89e46e969b9532cb7774887c8e7fce778e8b09c7926cd20de6fc985f1af81ffcd16c5a5ee55b62ad01d"]}}},{"context":{"level":"warn","file":"db_block.cpp","line":628,"method":"_apply_transaction","hostname":"","thread_name":"th_a","timestamp":"2018-01-29T09:50:42"},"format":"","data":{"trx":{"ref_block_num":34312,"ref_block_prefix":4177447021,"expiration":"2018-01-30T09:09:08","operations":[[6,{"fee":{"amount":35,"asset_id":"1.3.113"},"account":"1.2.681608","owner":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"active":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"extensions":{}}]],"extensions":[],"signatures":["200ad525ede016109cf8179a3b61cd73be43028f45ef06a89e46e969b9532cb7774887c8e7fce778e8b09c7926cd20de6fc985f1af81ffcd16c5a5ee55b62ad01d"]}}},{"context":{"level":"warn","file":"db_block.cpp","line":227,"method":"push_transaction","hostname":"","thread_name":"th_a","timestamp":"2018-01-29T09:50:42"},"format":"","data":{"trx":{"ref_block_num":34312,"ref_block_prefix":4177447021,"expiration":"2018-01-30T09:09:08","operations":[[6,{"fee":{"amount":35,"asset_id":"1.3.113"},"account":"1.2.681608","owner":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"active":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1],["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1]],"address_auths":[]},"extensions":{}}]],"extensions":[],"signatures":["200ad525ede016109cf8179a3b61cd73be43028f45ef06a89e46e969b9532cb7774887c8e7fce778e8b09c7926cd20de6fc985f1af81ffcd16c5a5ee55b62ad01d"]}}},{"context":{"level":"warn","file":"websocket_api.cpp","line":122,"method":"on_message","hostname":"","thread_name":"th_a","timestamp":"2018-01-29T09:50:42"},"format":"","data":{"call.method":"call","call.params":[3,"broadcast_transaction",[{"ref_block_num":34312,"ref_block_prefix":4177447021,"expiration":"2018-01-30T09:09:08","operations":[[6,{"fee":{"amount":"35","asset_id":"1.3.113"},"account":"1.2.681608","owner":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1],["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1]],"address_auths":[]},"active":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1],["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1]],"address_auths":[]},"extensions":[]}]],"signatures":["200ad525ede016109cf8179a3b61cd73be43028f45ef06a89e46e969b9532cb7774887c8e7fce778e8b09c7926cd20de6fc985f1af81ffcd16c5a5ee55b62ad01d"],"signer_private_keys":[],"extensions":[]}]]}}]}}

I created an issue at https://github.com/bitshares/bitshares-core/issues/607
Weibo:http://weibo.com/zhangweis

Offline zhangweis

  • Sr. Member
  • ****
  • Posts: 305
    • View Profile
I have an account(dge0003) registered with key BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu as owner and active auths and I want to change the owners and active auths to 2/3 of [BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu, BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE, BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k].
I made a transaction using bitsharesjs and signed with private key of BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu like below:
tr_buffer:
08866dc8fef83436705a010623000000000000007188cd290102000000000302bab5c458f5a10cf4ff5573de6c07b276c51bf48ae21b37f6b38dce80e97371c30100024a5a3c31e18bfd06c1f68df63699b94161c34f8dbb004c2f9dfef92f86bf06f5010003739244d3500d992386975496f722b946007e9843c4b678fa3887390fb5ee0a6d0100000102000000000302bab5c458f5a10cf4ff5573de6c07b276c51bf48ae21b37f6b38dce80e97371c30100024a5a3c31e18bfd06c1f68df63699b94161c34f8dbb004c2f9dfef92f86bf06f5010003739244d3500d992386975496f722b946007e9843c4b678fa3887390fb5ee0a6d010000000000
tx:
{"ref_block_num":34312,"ref_block_prefix":4177447021,"expiration":"2018-01-30T09:09:08","operations":[[6,{"fee":{"amount":"35","asset_id":"1.3.113"},"account":"1.2.681608","owner":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1],["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1]],"address_auths":[]},"active":{"weight_threshold":2,"account_auths":[],"key_auths":[["BTS6JicNdetyZf2kceu86Ms47iLNshty1rthKtnL7fSej7DtKyJNu",1],["BTS5TEb4CkHWyMJq62WrPtQVtzZBSCXD6BhjUXrVfdSztStrViNgE",1],["BTS7i8ePNeLCAxcWjaEeqsDFRZdSeMoF4gZmfe54EqrdX4AdQMY3k",1]],"address_auths":[]},"extensions":[]}]],"extensions":[],"signatures":["200ad525ede016109cf8179a3b61cd73be43028f45ef06a89e46e969b9532cb7774887c8e7fce778e8b09c7926cd20de6fc985f1af81ffcd16c5a5ee55b62ad01d"]}
signature:
200ad525ede016109cf8179a3b61cd73be43028f45ef06a89e46e969b9532cb7774887c8e7fce778e8b09c7926cd20de6fc985f1af81ffcd16c5a5ee55b62ad01d

But when I broadcast the signed transaction, I got a strange error:
message: 'missing required active authority: Missing Active Authority 1.2.681608',
data:
{ code: 3030001,
name: 'tx_missing_active_auth',
message: 'missing required active authority'.......
It's the same with the online wallet like https://bit.btsabc.org
If I change the owners and active to 1 keys(not 3 keys), it works without any problem. Like below:
tr_buffer:5b8719e085e115f96e5a01065c00000000000000009fa529000101000000000102f8ab2052da99051dd75717aa74d240e5ea06a20ec5708e1703d61040c344818b010000000000
{"ref_block_num":34651,"ref_block_prefix":3783647257,"expiration":"2018-01-29T10:36:05","operations":[[6,{"fee":{"amount":"92","asset_id":"1.3.0"},"account":"1.2.676511","active":{"weight_threshold":1,"account_auths":[],"key_auths":[["BTS6n1Fnc4oz3Lg2KUdJubsVPRzEfsF7ouo7ppTjDnmJYdfkeFb8Q",1]],"address_auths":[]},"extensions":[]}]],"extensions":[],"signatures":["207718a70e97aa1629a1a2c93dc85215eae64dc8822477a90cf10f5553a0d9413f511b6268aaf445fe983aad0b89870d896156f0b88bf872e56b2e4e1f69a9855a"]}
sig: 207718a70e97aa1629a1a2c93dc85215eae64dc8822477a90cf10f5553a0d9413f511b6268aaf445fe983aad0b89870d896156f0b88bf872e56b2e4e1f69a9855a

I'm using wss://eu.openledger.info/ws as api point.

« Last Edit: January 29, 2018, 09:55:19 am by zhangweis »
Weibo:http://weibo.com/zhangweis