Bitcoin
bitcoin core – How to create BitcoinSigningInput from hexadecimal (WalletCore)
Hello everyone!
We are looking to implement BTC/LTC/DOGE transfers through the backend of our mobile app. Before that I used the WalletCore library.
The previous steps are as follows:
- to make
BitcoinUnspentTransaction
. - to make
BitcoinSigningInput
withBitcoinUnspentTransaction
It’s in the utxos parameter. - signature
BitcoinSigningInput
. - broadcast.
The current new trends are as follows:
- The backend asks for input.
- Sign your input.
- Send all required data to the backend (enter amount, signature).
- Broadcast using a backend.
So I took input from the backend and ran into some issues. I need BitcoinSigningInput
(WalletCore class). Therefore, I think I must create. BitcoinSigningInput
From input received from the backend. However, I don’t understand at all how to convert these inputs (received in HEX format) to: BitcoinSigningInput
These are the types that can be signed using WalletCore.
I’m trying a few different methods. The final method is as follows:
let data = Data(hex:utxosBackend)
let input = try BitcoinSigningInput(serializedData: data)
But this causes an error: truncated
Thank you so much for your help!