how to use verifymessage

+1 vote

Please can you help me to understand how to use verifymessage() function.

A) tested TX:

 TXID 

58b0b0f4a93d587ce3c1774f09dac6f8a315cc942dc47f3267bdf746c13527ee

TX hash 010000000149a155579d41a4c525458b7f10816cbbb1c815084a328fe595f9b3a9f651a82c000000006b483045022100d160a4e2b6145ac2535474a22030016373f0d432d5f6e317d0b6cdbe5cf4e5a30220050df4f9b19f9d68d1ebc9618a09da42df6bde561f3f9671905e7c330d1075fe012103a204455ed02b9ac9b3814c5ac170a2da79d71d36646fd194b67456f1d6d08848ffffffff0200000000000000003776a914432c4b4c39d5e794d57cf608114605f6add3f87888ac1c73706b71e0c385492d178b82fd2a5406328879a901000000000000007500000000000000003776a914a0ffe47e4803d11078cc6a024cb639e4e23cb4d988ac1c73706b71e0c385492d178b82fd2a5406328879a901000000000000007500000000 

B) sourcing TX

 TXID     

2ca851f6a9b3f995e58f324a0815c8b1bb6c81107f8b4525c5a4419d5755a149

TX hash 0100000001651b6e4baa22e33e73c80e5a81b95f682f3e6e5dbeb2a0a4cb783af6f26cb31d000000006a473044022062200756ccc1f74461a812916a51ac86ddd98414fa71efce09512a833c095238022028410d46f44bd357a1ff623a788ae5127c502f2d04e2004212da3b8a976f4f78012103a204455ed02b9ac9b3814c5ac170a2da79d71d36646fd194b67456f1d6d08848ffffffff0300000000000000003776a914a0ffe47e4803d11078cc6a024cb639e4e23cb4d988ac1c73706b6fe0c385492d178b82fd2a5406328879a902000000000000007500000000000000001e1473706b65e0c385492d178b82fd2a5406328879a9750573706b7501756a00000000000000001976a914a0ffe47e4803d11078cc6a024cb639e4e23cb4d988ac00000000    

Prepared variables:

1) address   

  1Nm5AaXHDXmBvkaJp3nTVLVTd3Ak8m5KRkZecB

2) signature     

483045022100d160a4e2b6145ac2535474a22030016373f0d432d5f6e317d0b6cdbe5cf4e5a30220050df4f9b19f9d68d1ebc9618a09da42df6bde561f3f9671905e7c330d1075fe

3) message

raw format (following bitcoin instructions)    010000000149a155579d41a4c525458b7f10816cbbb1c815084a328fe595f9b3a9f651a82c000000001976a914a0ffe47e4803d11078cc6a024cb639e4e23cb4d988ffffffff0200000000000000003776a914432c4b4c39d5e794d57cf608114605f6add3f87888ac1c73706b71e0c385492d178b82fd2a5406328879a901000000000000007500000000000000003776a914a0ffe47e4803d11078cc6a024cb639e4e23cb4d988ac1c73706b71e0c385492d178b82fd2a5406328879a90100000000000000750000000001000000

 hash256() format

8855137481f7070f90933c2181688766bc1d6c72c81345740fe6370e908ffe43

reversed hash256() format

43fe8f900e37e60f744513c8726c1dbc66876881213c93900f07f78174135588

Used Function in MultiChain-CLI

verifymessage 1Nm5AaXHDXmBvkaJp3nTVLVTd3Ak8m5KRkZecB 483045022100d160a4e2b6145ac2535474a22030016373f0d432d5f6e317d0b6cdbe5cf4e5a30220050df4f9b19f9d68d1ebc9618a09da42df6bde561f3f9671905e7c330d1075fe 8855137481f7070f90933c2181688766bc1d6c72c81345740fe6370e908ffe43

return - false

verifymessage 1Nm5AaXHDXmBvkaJp3nTVLVTd3Ak8m5KRkZecB 483045022100d160a4e2b6145ac2535474a22030016373f0d432d5f6e317d0b6cdbe5cf4e5a30220050df4f9b19f9d68d1ebc9618a09da42df6bde561f3f9671905e7c330d1075fe 43fe8f900e37e60f744513c8726c1dbc66876881213c93900f07f78174135588

also return - false

Please can you check where I made mistake?

Thank you

asked Nov 17, 2017 by anonymous

1 Answer

0 votes

You should use verifymessage to check a signature created with signmessage, rather than creating a signature manually as above.

answered Nov 17, 2017 by MultiChain
...