I have made my own implementation of segwit in Scala, so hopefully I won't be relying on bitcoinj that much. Have tested on testnet. Sharing my code for others to review and use. Note that its in Scala but should be easy to use for Java devs.
https://github.com/scalahub/bitcoinS examples here: https://github.com/scalahub/bitcoinS/blob/master/BitcoinS_Tests/src/sh/TestTx.scala An extract from the above explaining how to use it: val key = new sh.ecc.PrvKey(" BB2AC60BC518C0E239D5AF9D8D051A6BDFD0D931268DCA70C59E5992", true) // true = compressed val tx0 = createSegWitTxRaw(Seq(in0,in1,in2,in3,in4,in5,in6), Seq(out1)) // unsigned tx, 7 inputs, 1 output val tx1 = key.signTx_P2PKH (tx0, Seq(0, 2, 5)) // inputs 0, 2, 5 are P2PKH val tx2 = key.signTx_P2SH_P2WPKH(tx1, Seq((1, 2031250), (6, 1015625))) // inputs 1, 6 are segwit. Those need the input value in satoshis as well val signed = key.signTx_P2SH_P2PK(tx2, Seq(3, 4)) // inputs 3, 4 are P2SH_P2PK Regards Amit On Sunday, November 12, 2017 at 1:56:34 PM UTC+5:30, Amitabh Saxena wrote: > > Can bitcoinj listen and understand segwit transactions and can it create > segwit transactions? Which branch should I clone? > -- You received this message because you are subscribed to the Google Groups "bitcoinj" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
