Join and earn Bitcoin Cash for participation

Dev Blog: Recent Updates to Bitcoincashj

10 185
Avatar for pokkst
Written by   71
1 week ago

Hey everyone!

In this article I'm going to go over recent updates to the Bitcoin Cash Java library bitcoincashj. There's been a lot of exciting updates to it since I last talked about it!

First off, I have fixed a bug with SLP transaction building. There was a bug for a short while where no outputs were created in a transaction besides the OP_RETURN. The cause of this bug was due to the addOutput calls being commented out during the major refactor of bitcoincashj where I pulled upstream fixes/changes from bitcoinj into bitcoincashj and had to rewrite a lot of stuff.

I guess that leads me to the next change: There has been a MAJOR refactor of bitcoincashj. Previously, it had not fetched upstream for fixes/changes in bitcoinj in nearly two years. Now it is mostly up-to-date with bitcoinj in terms of security improvements, bug fixes, and general improvements.

Another big addition is the Simple Ledger Payment Protocol, also known as BIP70 SLP. This was added in so Crescent Cash would be able to pay invoices on tipbitcoin.cash, since tipbitcoin.cash now uses BIP70 for both BCH and SLP. The only other wallet to support this at the moment is Badger Wallet, but there is an update coming out soon to Electron Cash SLP that adds BIP70 SLP support.

Download Crescent Cash and try out tipping on tipbitcoin.cash!

And finally, bitcoincashj now has support for OP_CHECKDATASIG and OP_REVERSEBYTES.

The OP_CHECKDATASIG code was not written by me, however. There existed another fork of bitcoincashj that a couple other people had started, but it quickly died out. They added OP_CHECKDATASIG support, so I merged their changes into my fork of bitcoincashj. The original fork that had OP_CHECKDATASIG is https://github.com/blocksy-net/bitcoincashj

I recently added support for the new OP_REVERSEBYTES opcode. You can see tests here: https://github.com/pokkst/bitcoincashj/blob/master/core/src/test/java/org/bitcoinj/script/ScriptReverseBytesTest.java

This is a very simple opcode. It takes the bytes of the previous item in the stack and... reverses them. The example tests scripts are OP_DUP OP_REVERSEBYTES OP_EQUAL, to see if the test string is the same both backwards and forwards.

This is also the same script Tobias Ruck used in his example OP_REVERSEBYTES P2SH address. (bitcoincash:prh3syz7kke338qvr7gutjwps2ka6uczrqcmup4p2m)

An example spend transaction is also in the ScriptReverseBytesTest.java linked above. Here is a transaction spending from that P2SH address, using the test from above: 4dc3bbcc00fe2a453389e9e0b38fc803b2a2e6e17d60915c92ba1dfffee7b9e1

This about concludes all the recent updates to bitcoincashj. There are some minor bug fixes here and there, but those aren't really worth mentioning since they're minor.

Thank you for reading!

pokkst

13
$ 13.68
$ 10.00 from @MarcDeMesel
$ 1.00 from @emergent_reasons
$ 1.00 from @DavidRAllen
+ 6
Avatar for pokkst
Written by   71
1 week ago
Enjoyed this article?  Earn Bitcoin Cash by sharing it! Explain
...and you will also help the author collect more tips.

Comments

Thanks for the updates 🙌🏻

$ 0.00
1 week ago

Thanks for this.. Its very informative and educative. Now one lesson thought today.

$ 0.00
1 week ago

Woww!This is an interesting article.ofcourse also technically detailed article. Who works in that field they will find it easy to understand.

$ 0.00
1 week ago

I havent heard of this before so i find this difficult to understsnd but. Thnsk for sharing it will be helpful for those. Who can understand

$ 0.00
1 week ago

This is very wonderful post. I read your post willingly. You get many informative information. Now i know about this thing.Thank you for sharing your information.

$ 0.00
1 week ago

The most important things in online earning is bitcoin cash. This is too difficult and you said it easily. Hope you share your experience next time. Thank you

$ 0.00
1 week ago

This is an interesting and well technically detailed article. A layman in the field of computer and cryptocurrency will even find it easy to understand.

$ 0.00
1 week ago

Some good technical work here. May bitcoincashj be super successful! Look forward to you next update!

$ 0.00
1 week ago

This is an interesting concept I havent heard of before, thanks for your work in the scene.

$ 0.00
1 week ago
About us Rules What is Bitcoin Cash? Roadmap Affiliate program Get sponsored Self-host
hello@read.cash (PGP key) Reddit