How can I sign bitcoin transaction offline use bitcoinj and some other c programs

363 Views Asked by At

We are want to do a device like trezor or ledger , and we try to sign transaction in the offline device which use c program like trezor , first our online app get utxos and get the TansactionInput , but we do not know how to change the inputs to the pre sign hash , and also the sign with c program . is there anybody had to do like this and could you give us some advice?

1

There are 1 best solutions below

0
On

Look at packages like python-trezor. They have a tool in it called trezorctl that allows offline TXN creation. Technically you need to need to get TX data from a server, but it is a small amount of data, and easy to spoof in SW if proof-of-concept bears out.

Here's an example of a simple_trezor_txn-py script in 50 lines that does most of what you need.