horizontalsystems / bitcoin-kit-ios

Comprehensive Bitcoin development library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash, Litecoin and Dash blockchains. Comprehensive Bitcoin development library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash, Litecoin and Dash blockchains. Fully compliant with existing standards and BIPs.
https://unstoppable.money
MIT License
241 stars 72 forks source link

Signing Transactions with a private key #567

Open srikanthsrnvs opened 3 years ago

srikanthsrnvs commented 3 years ago

Can you expose a method to directly sign a transactions without needing to sync to the blockchain?

We run our own full nodes, so construct the raw transactions on our end, and merely need to sign the transaction on the device, and send it back to the server for propagation

How Can I do this with your library, or is there an easier way/?

For the record, we want to sign the raw transaction created using bcoin with bitcoin core 0.21

esen commented 3 years ago

Hi @srikanthsrnvs,

Unfortunately, it's not possible in this kit. Because this kit is designed to manage all kinds of transactions including ones with non-standard scripts like HTLC locked transactions available in Hodler kit. That's why it needs an instance of MutableTransaction with all the detailed information about the inputs/outputs to sign it. A raw transaction cannot be signed so easily.