Alright, Thanks On Saturday, April 21, 2018 at 9:45:45 PM UTC+5, Andreas Schildbach wrote: > > Ok, to make it more formal I just opened this PR: > > https://github.com/bitcoinj/bitcoinj/pull/1563 > > I invite you to use the code from the PR. Look at the provided test > cases for how to derive segwit addresses. Feek free to report and > problems you have, I'm interested in how it works for you. > > > On 04/18/2018 08:06 PM, Tyga wrote: > > Alright, now I am using master branch, but can't figure out, How can I > > generate SegwitAddress's using SegwitAddress Class and make > > wallet listen to this SegWit Address. ? > > > > On Tuesday, April 17, 2018 at 9:12:10 PM UTC+5, Andreas Schildbach > wrote: > > > > The 0.14 branch is ~2 years old and has got no support for segwit at > > all. For receiving on native Segwit addresses, you can use the > master > > branch. For receiving on P2WPKH-P2SH, I'm not sure. If master > doesn't > > work you can try the segwit branch (but that one isn't tested well). > > > > Warning: master currently has no support for spending segwit > > outputs. So > > only use testnet or really small amounts for now. I hope I can merge > > back signing from the segwit branch to master soon. > > > > > > On 04/16/2018 11:55 PM, Tyga Christed wrote: > > > i am worrking on bitcoinj <version>0.14.7</version> > > > > > > On Tuesday, April 17, 2018 at 2:21:53 AM UTC+5, Andreas Schildbach > > wrote: > > > > > > What branch or commit are you working on? > > > > > > > > > > > > On 04/16/2018 06:41 PM, Tyga Christed wrote: > > > > I am generating Segwit address like this > > > > > > > > Address.fromP2SHScript(params,segWitOutputScript()); > > > > > > > > > > > > public static Script segWitOutputScript() { > > > > > > > > // > > > > // OP_HASH160 hash160(redeemScript) OP_EQUAL > > > > // > > > > byte[] hash = > > Utils.sha256hash160(segWitRedeemScript().getProgram()); > > > > byte[] buf = new byte[3 + hash.length]; > > > > buf[0] = (byte)0xa9; // HASH160 > > > > buf[1] = (byte)0x14; // push 20 bytes > > > > System.arraycopy(hash, 0, buf, 2, hash.length); // keyhash > > > > buf[22] = (byte)0x87; // OP_EQUAL > > > > > > > > return new Script(buf); > > > > } > > > > > > > > public static Script segWitRedeemScript() { > > > > > > > > // > > > > // The P2SH segwit redeemScript is always 22 bytes. It > > starts with a > > > > OP_0, followed by a canonical push of the keyhash (i.e. > > > 0x0014{20-byte > > > > keyhash}) > > > > // > > > > ECKey ecKey = new ECKey(); > > > > > > > > byte[] hash = Utils.sha256hash160(ecKey.getPubKey()); > > > > byte[] buf = new byte[2 + hash.length]; > > > > buf[0] = (byte)0x00; // OP_0 > > > > buf[1] = (byte)0x14; // push 20 bytes > > > > System.arraycopy(hash, 0, buf, 2, hash.length); // keyhash > > > > > > > > return new Script(buf); > > > > } > > > > > > > > > > > > i am not able to receive payment on the Segwit Address, but > > when i > > > send payment on Standard Addr then i receive it. > > > > > > > > what i am doing wrong here ? > > > > > > > > -- > > > > 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] > > > > <mailto:[email protected]>. > > > > For more options, visit https://groups.google.com/d/optout > > <https://groups.google.com/d/optout> > > > <https://groups.google.com/d/optout > > <https://groups.google.com/d/optout>>. > > > > > > > > > -- > > > 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] > > > <mailto:[email protected]>. > > > For more options, visit https://groups.google.com/d/optout > > <https://groups.google.com/d/optout>. > > > > > > -- > > 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] <javascript:> > > <mailto:[email protected] <javascript:>>. > > For more options, visit https://groups.google.com/d/optout. > > >
-- 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.
