Bitcoin Cryptocurrency Mastering Development

How to sign a 2-of-2 multisig address?

I want to implement 2-of-2 multisig in bitcoinj, and I implement the methods which are used to sign the first time and the second time. But there is a bug that using the same key for the first signing and second signing can also pass the transaction verification and can be broadcast. Where the mistake […]

Bitcoin Cryptocurrency Development

spend from p2sh with bitcoinj

i am try to spend the coins on a p2sh first, i generate p2sh and send coins to that p2sh ECKey clientKey = new ECKey(); ECKey serverKey = new ECKey(); ECKey thirdPartyKey = new ECKey(); List<ECKey> keys = ImmutableList.of(clientKey, serverKey,thirdPartyKey); Script multisigScript = ScriptBuilder.createP2SHOutputScript(2, keys); String address = multisigScript.getToAddress(params).toString(); then i send coins to the […]

Cache Development GitHub

how to sign bitcoin psbt with ledger?

I’m trying to sign a Psbt transaction from bitcoinjs-lib following what I found here: I’ve checked that the compressesd publicKey both from ledger, and the one from bitcoinjsLib returned the same value. I could sign it with the bitcoinjs-lib ECPair, but when I tries to sign it using ledger, it is always invalid. Can […]