Announcing hxBitcoin, the Bitcoin and crypto library for Haxe

137 views
Skip to first unread message

Chuck Batson

unread,
Dec 17, 2014, 11:52:23 AM12/17/14
to haxe...@googlegroups.com
hxBitcoin is a new open source Bitcoin and cryptocurrency support library in the Haxe language.

The initial release has these features:
  • BIP0038 (encrypted private keys), WIF, private & public keys, addresses, Base58
  • scrypt, AES, SHA-1, SHA-256, RIPEMD160
  • Elliptic curve arithmetic, secp256k1 & NIST curves
  • Modular arithmetic (Fp), Arbitrary-size (big) integer, Unicode 7.0
and supports iOS, Windows, OSX, Flash, and NekoVM targets (additional targets are easy, just ask).

It’s a clean, simple API in pure Haxe with no additional or external dependencies.

Built in Haxe, hxBitcoin has extensive reach to enable applications on desktop, mobile, web, and server platforms, targeting C++, Java, JS, PHP, AS3 and more with a single code base.

It’s also backed by an extensive test suite of over 22,000 individual tests and vectors to validate correct behavior on all supported platforms.

To start using, simply install the library via haxelib:

haxelib install hxBitcoin

Here’s an example of how to decrypt a BIP0038 private key:

import com.fundoware.engine.bitcoin.FunBitcoinContext;
import com.fundoware.engine.bitcoin.FunBitcoinEncryptedPrivateKey;
import com.fundoware.engine.bitcoin.FunBitcoinPrivateKey;

var context = new FunBitcoinContext();
var encryptedKey = FunBitcoinEncryptedPrivateKey.fromString(
    context
, "6PRVWUbkzzsbcVac2qwfssoUJAN1Xhrg6bNk8J7Nzm5H7kxEbn2Nh2ZoGg");
var decryptedKey = encryptedKey.decryptString("TestingOneTwoThree");
encryptedKey
.clear();
trace
("private key (WIF) = " + decryptedKey.toWIF());
var address = decryptedKey.toAddress();
decryptedKey
.clear();
trace
("address = " + address);

Project website: http://hxBitcoin.com


Feature requests welcome!

Simon Krajewski

unread,
Dec 17, 2014, 11:58:43 AM12/17/14
to haxe...@googlegroups.com
Awesome!

Feature request: Let travis run your tests so we can check them as part of our third party tests on each compiler update (see https://github.com/HaxeFoundation/haxe/issues/3692).

Simon

Franco Ponticelli

unread,
Dec 17, 2014, 12:16:43 PM12/17/14
to haxe...@googlegroups.com
Super awesome!

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Chuck Batson

unread,
Dec 17, 2014, 12:17:02 PM12/17/14
to haxe...@googlegroups.com
Thanks, Simon!  Will do.

David Elahee

unread,
Dec 17, 2014, 12:38:38 PM12/17/14
to haxe...@googlegroups.com

Nice !

--

Tarwin Stroh-Spijer

unread,
Dec 17, 2014, 3:28:05 PM12/17/14
to haxe...@googlegroups.com
Wow, that's awesome mate. Good work D:



Tarwin Stroh-Spijer
_______________________

phone: +1 650 842 0920

Developer at Fanplayr Inc. (Palo Alto)
Original at Touch My Pixel (touchmypixel.com)
_______________________

Nicolas Cannasse

unread,
Dec 17, 2014, 3:49:35 PM12/17/14
to haxe...@googlegroups.com
Le 17/12/2014 17:52, Chuck Batson a écrit :
> hxBitcoin is a new open source Bitcoin and cryptocurrency support
> library in the Haxe language.
>
> The initial release has these features:
>
> * BIP0038 (encrypted private keys), WIF, private & public keys,
> addresses, Base58
> * scrypt, AES, SHA-1, SHA-256, RIPEMD160
> * Elliptic curve arithmetic, secp256k1 & NIST curves
> * Modular arithmetic (Fp), Arbitrary-size (big) integer, Unicode 7.0

Nice !

Would you be interested in contributing the standardized crypto
implementations (not bitcoin-specific) to the haxe standard library into
the haxe.crypto package ?

If yes, please send a us a Pull Request on Github, with the
corresponding unit tests.

Best,
Nicolas

Sam MacPherson

unread,
Dec 17, 2014, 5:48:59 PM12/17/14
to haxe...@googlegroups.com
AES would be great to have in haxe.crypto.

Chuck Batson

unread,
Dec 18, 2014, 9:46:47 AM12/18/14
to haxe...@googlegroups.com
Hi Nicolas! Yes I think that will be do-able for the lower-level items like hashes and encryption. I'd like to let it "mature" for a bit of time, as I was expecting to be able to make breaking changes to the API when needed. I'd also like to get some documentation in there. I'll put this in my to-do list.

For the higher-level things like EC arithmetic, there are many different ways to implement it depending on application requirements, so those sorts of things may not be best placed in Haxe proper.

Chuck
Reply all
Reply to author
Forward
0 new messages