yenom / BitcoinKit

Bitcoin protocol toolkit for Swift
MIT License
842 stars 262 forks source link

Get signature as expected. #253

Open rachkumar opened 4 years ago

rachkumar commented 4 years ago

Hi I can able to sign a message by: let message = "Hi BTC".data(using: .utf8)! let signatureData = try Crypto.sign(message, privateKey: wallet.privKeys[0]).

Now am following the link https://www.blockcypher.com/dev/bitcoin/#creating-transactions for the transaction.

Above link expected to sign data as

Hashing the hex-encoded string twice using SHA256 should give you back the corresponding tosign data. Decoding the hex-encoded string using our /txs/decode endpoint (or an independent, client-side source) should give you the output addresses and amounts that match your work-in-progress transaction.

I think it not matching with their requirements.

How to do this with our SDK..Please help to solve this..