# \[In Development\] Bitcoin.jl - A Julia bitcoin library

**URL:** <https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944>\
**Category:** Package Announcements\
**Created:** [November 24, 2018, 3:53pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944 "2018-11-24T15:53:13Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [January 23, 2019, 12:51pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/21 "2019-01-23T12:51:42Z")

</div>

Are you implementing a full interpreter for Script or do you just want to figure out to what wallet address a transaction is going?

I just saw, that I don’t have a dedicated `Script` type, [`BTCParser`](https://github.com/gdkrmr/BTCParser.jl/blob/master/src/lib/transaction.jl#L101) just uses `Array{UInt8}`, I should change that 🙂 .

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [January 23, 2019, 1:35pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/22 "2019-01-23T13:35:54Z")

</div>

Aiming for a full interpreter: OP\_CODES are mostly implemented already.

Nice parser you did 👍

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 23, 2019, 2:32pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/23 "2019-01-23T14:32:01Z")

</div>

> [@Tamas\_Papp](#):
>
> > The compiled binaries from GPL code need to be non-proprietary,
> 
> I am not sure what that means in this context

I meant with no restrictions (be free software; not wasn’t talking about cost here, you can still charge for software) not allowed by the GPL.

At least Stallman defines proprietary/non-free this way.

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [February 1, 2019, 10:42am UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/24 "2019-02-01T10:42:41Z")

</div>

A new milestone has been reached and package with be shortly published.  
It now provides functionality that allows to fetch bitcoin transaction from nodes, get transaction ID, serialization, fee, signature hash and script evaluation.

More to come of course!

---

<div class="post-metadata">

**Author:** ![swissr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swissr/32/208_2.png) [@swissr](https://discourse.julialang.org/u/swissr)\
**Post date:** [February 1, 2019, 11:58am UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/25 "2019-02-01T11:58:28Z")

</div>

> [@roshii](#):
>
> I am indeed relying on your Ripemd.jl package, thanks for that 🙂

Just to mention: Ripemd.jl is a MIT licensed package…

After having a look at [https://www.brane.cc](https://www.brane.cc) [fixed wrong link, sorry] and [Simon C. - Épinal, Grand Est, France | Professional Profile | LinkedIn](https://www.linkedin.com/in/sjcastano/) I can understand that you feel the urge to keep the package under GPLv3 wraps.

It’s completely your call, but this decision could/will also bite you:

- in case people contribute to your package you are also bound to the GPLv3. From the links above I get that you are interested ‘in business’, but you wouldn’t be able to use the package in proprietary settings (without ripping out the contributions)
- you talk about _collaboration_ but with your license choice you are _not_ able to collaborate with the wider Julia package ecosystem. It’s a one way street 🛑. Most likely less people will bother.
- (I’m not interested in Bitcoin, but if I were, I’d start from scratch. And I also would certainly _not_ look at your code at all because this taints)

This said, I’m not generally against GPL. One of the most beautiful Julia package I know, is: [GitHub - chakravala/Dendriform.jl: Dendriform di-algebra algorithms to compute using Loday's arithmetic on groves of planar binary trees](https://github.com/chakravala/Dendriform.jl) (edit: ups, I meant [GitHub - chakravala/Fatou.jl: Fatou sets in Julia (Fractals, Newton basins, Mandelbrot)](https://github.com/chakravala/Fatou.jl) - and this is MIT). In your case I wonder, if not find funding and develop a normal MIT licensed package would be the better choice.

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [February 1, 2019, 1:46pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/26 "2019-02-01T13:46:52Z")

</div>

Hum… My business idea is about data, software would/should be open source and so I think this would not be an issue but I didn’t realize GPL would be such a problem (especially considering your third point), that for pointing it out.

I’m now seriously considering switching over to LGPL which would only force amendment of the library itself to be released under LGPL - therefore making any improvement open source as well - while allowing the library to be used in proprietary code.  
Would this license ease collaboration in your opinion? Or is MIT the only collaborative friendly license?

> [@swissr](#):
>
> After having a look at [https://www.brane.cct](https://www.brane.cct)

That would be [https://www.brane.cc](https://www.brane.cc) for whomever is interested at reading about my wider project.

---

<div class="post-metadata">

**Author:** ![swissr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swissr/32/208_2.png) [@swissr](https://discourse.julialang.org/u/swissr)\
**Post date:** [February 1, 2019, 4:07pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/27 "2019-02-01T16:07:08Z")

</div>

> [@roshii](#):
>
> I’m now seriously considering switching over to LGPL which would only force amendment of the library itself to be released under LGPL - therefore making any improvement open source as well - while allowing the library to be used in proprietary code.  
> Would this license ease collaboration in your opinion? Or is MIT the only collaborative friendly license?

As long as you are the only author you have time. Ask around, think it through (e.g. what exactly would I loose when someone takes my (your bitcoin) code and does proprietary stuff on top of it, how likely is this, what are my longterm plans) and then decide, no hurry, you should be comfortable.

I don’t have a clear opinion and I also don’t have insight into the (professional) Julia ecosystem. My thoughts go along:

- do I want to stick out or go with what is custom? Do I need to stick out?
- do I need/want to attract other developers, how likely are they to help with the different licenses?
- is there a ‘risk’ that someone starts anew with MIT license and there are two ‘competing’ packages (on the other hand there are quite often different possibilities with Julia packages…😉 )
- if I had to choose, I would probably either go proprietary or ‘full free’, i.e. GPLv3 or AGPLv3 (because in ‘bitcoin-world’ services might be important?) or then ‘full open’, i.e. MIT. – Regarding LGPL (and MPL, Apache,…) there’s imho no clear benefit, it is just different from what most Julia users use. ([Edit:] JuMP.jl uses MPL 2.0, should have mentioned)
- without an important personal business case I likely would switch to MIT. For an R package I’d choose GPL, but for Julia I’d go with MIT. I think the chance is bigger to find oneself in the center of a project (Julia-based bitcoin) if sticking to mainstream!
- (by chance I came yesterday across this R blogger article: [How GPL makes me leave R for Python :-( | R-bloggers](https://www.r-bloggers.com/how-gpl-makes-me-leave-r-for-python/). There were some very morally comments and I quite appreciate that with MIT this is much more relaxed. Also I believe the license (except agpl) is maybe no longer as important as in earlier times due to SaaS)

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [February 2, 2019, 2:23pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/28 "2019-02-02T14:23:56Z")

</div>

Thanks again @swissr

After careful consideration, I have decided to switch to an _unlicense_ which I guess should not be an issue for collaboration since it cannot be more permissive.

### What is the Unlicense?

> The Unlicense is a template for [disclaiming copyright monopoly interest](http://cr.yp.to/publicdomain.html) in software you’ve written; in other words, it is a template for dedicating your software to the [public domain](http://stpeter.im/writings/essays/publicdomain.html). It combines a copyright waiver [patterned](http://ar.to/2010/01/dissecting-the-unlicense) after the [very successful](http://www.sqlite.org/famous.html) public domain [SQLite](http://www.sqlite.org/) project with the no-warranty statement from the widely-used [MIT/X11 license](http://en.wikipedia.org/wiki/MIT_License).

### Why Use the Unlicense?

> Because you have more important things to do than enriching lawyers or imposing petty restrictions on users of your code. How often have you passed up on utilizing and contributing to a great software library just because its [open source](http://www.opensource.org/) license was not compatible with your own preferred [flavor](http://www.opensource.org/licenses/alphabetical) of open source? How many precious hours of your life have you spent deliberating how to license your software or worrying about licensing compatibility with other software? You will never get those hours back, but here’s your chance to start cutting your losses. Life’s too short, let’s get back to coding.

Further to the above, I am not inventing anything with this Bitcoin library, just implementing it in Julia…  
I would also have no means to enforce any license I would choose, so why bother?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 2, 2019, 2:50pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/29 "2019-02-02T14:50:01Z")

</div>

IANAL, but GNU [recommends CC0 over the Unlicense](https://www.gnu.org/licenses/license-list.en.html#Unlicense), considering it “more thorough and mature” for the same purpose.

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [February 2, 2019, 3:22pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/30 "2019-02-02T15:22:12Z")

</div>

> [@Tamas\_Papp](#):
>
> GNU [recommends CC0 over the Unlicense](https://www.gnu.org/licenses/license-list.en.html#Unlicense)

Which I find rather weird since CC0 is not intended for software per se 🤔  
Another hint in favor of The Unlicense is that CC0 isn’t available as a license template on Gihub/Gitlab whereas the former is.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 2, 2019, 3:41pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/31 "2019-02-02T15:41:11Z")

</div>

> [@roshii](#):
>
> CC0 is not intended for software per se 🤔

Historically, no, but the [demand is now recognized](https://creativecommons.org/2011/04/15/using-cc0-for-public-domain-software/) and [the issue was discussed with the FSF](https://wiki.creativecommons.org/wiki/CC0_FAQ#May_I_apply_CC0_to_computer_software.3F_If_so.2C_is_there_a_recommended_implementation.3F).

I think that license templates just reflect popularity/demand. In any case, you can use an arbitrary license.

Personally, I would just stick to MIT if I was aiming for the widest user base, if only because it is familiar. Anything like the Unlicense, the [WTFPL](http://sam.zoy.org/wtfpl/COPYING), or even CC0 will just make the user pause and search the web for opinions, or skip the software entirely (in a risk averse/corporate setting). The fact that you readily switched from GPL to Unlicense suggests that you don’t have a strong preference, so you may as well go for MIT.

(Apologies if this is a distraction to your announcement of an interesting library. But I think these discussions are important for Julia packages in the long run.)

---

<div class="post-metadata">

**Author:** ![Nosferican](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nosferican/32/9275_2.png) [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Post date:** [February 2, 2019, 5:28pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/32 "2019-02-02T17:28:01Z")

</div>

For permissive licenses I recommend,  
[Apache 2.0](https://opensource.org/licenses/Apache-2.0) Safeguard against potential patent issues  
[ISC](https://opensource.org/licenses/ISC) Updated version of MIT  
[BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) for protecting brand  
[Zlib](https://opensource.org/licenses/Zlib) for academic software

More than legal tools such as copyleft, the first best is a change in social norms which has progressed a lot and such the rise of permissive over copyleft licenses in many communities.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 2, 2019, 8:16pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/33 "2019-02-02T20:16:32Z")

</div>

> [@roshii](#):
>
> Would this license ease collaboration in your opinion? Or is MIT the only collaborative friendly license?

The LGPL is also good (I wouldn’t say the GPL, or AGPL is bad). Some have a linking exception for the LPGL (or GPL) to make all use even easier.

Then it seems you could go with MPL (version 2.0). It’s the weakest form of copyleft license I know of, shouldn’t scare anyone (well would keep collaborators with relevant patents away); also popular. The MPL and Apache licenses help users knowing they will not get into patent issues.

---

<div class="post-metadata">

**Author:** ![swissr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swissr/32/208_2.png) [@swissr](https://discourse.julialang.org/u/swissr)\
**Post date:** [February 2, 2019, 9:15pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/34 "2019-02-02T21:15:19Z")

</div>

> [@Palli](#):
>
> Then it seems you could go with MPL (version 2.0)

[JuMP.jl](https://github.com/JuliaOpt/JuMP.jl) uses MPL 2.0. (Only thought of this after I wrote my post above).

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [February 4, 2019, 8:26am UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/35 "2019-02-04T08:26:01Z")

</div>

> [@Tamas\_Papp](#):
>
> The fact that you readily switched from GPL to Unlicense suggests that you don’t have a strong preference, so you may as well go for MIT.

I was going for GPL for ideological reasons but had never thought of its implication up to now. All things considered, I then thought The Unlicense would be the best option since I do not care much if my name is not mentioned if my code is used somewhere else - being the sole requirement of MIT license if I understand correctly. But legally, it seems that the Unlicense isn’t even applicable in some jurisdiction:

> <https://softwareengineering.stackexchange.com/questions/147111/what-is-wrong-with-the-unlicense>

So, after some days reading about licenses, MIT seem to make the most sense:

- GPL-3.0 could render my code unused
- LGPL-3.0 could have the very same impact, but at a lesser extend
- MPL-2.0 / Apache-2.0 offers patent protection that I do not see a need for since I’m not inventing anything but simply implementing existing software in a new language

\*\*\* now we start with licenses that non-lawyer can understand \*\*\*

- ISC isn’t that popular in general
- BSD-2-Clause / BSD-3-Clause would both work
- MIT achieves the same as the previous understandable licenses and has the advantage of being well known

I’ll finish with satoshi’s motivation for choosing MIT for bitcoin:

[https://satoshi.nakamotoinstitute.org/posts/bitcointalk/451/](https://satoshi.nakamotoinstitute.org/posts/bitcointalk/451/)

> [@Tamas\_Papp](#):
>
> (Apologies if this is a distraction to your announcement of an interesting library. But I think these discussions are important for Julia packages in the long run.)

No bother, it is indeed important - I should have maybe moved /added this discussion to this [Package License](https://discourse.julialang.org/t/package-license/7109) thread…

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [February 4, 2019, 5:19pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/36 "2019-02-04T17:19:50Z")

</div>

v0.1.1 has just been release, under MIT license

Anyone may test functionalities using `Pkg.add("Bitcoin")`

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [March 3, 2019, 8:54pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/37 "2019-03-03T20:54:27Z")

</div>

If you’ve wondered if it was possible to sign bitcoin transaction with GPG, check-out this [tutorial](https://bitcoindev.network/using-gpg-as-a-bitcoin-address/) using Bitcoin.jl and a quick and dirty PGP parser in julia

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [March 5, 2019, 9:47am UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/38 "2019-03-05T09:47:34Z")

</div>

v0.1.6 has been released adding op\_checkmultisig and P2SH support

---

<div class="post-metadata">

**Author:** ![roshii](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roshii/32/6211_2.png) [@roshii](https://discourse.julialang.org/u/roshii)\
**Post date:** [March 15, 2019, 8:09pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/39 "2019-03-15T20:09:34Z")

</div>

v0.1.8 has just been released

Package now allows for basic functionality of peer to peer network communication.  
My first steps using Sockets and async macro, a new world 🙂

Once again, comments are more than welcome.

Next release to add more network and Merkel tree functions

---

<div class="post-metadata">

**Author:** ![anon67531922](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anon67531922](https://discourse.julialang.org/u/anon67531922)\
**Post date:** [March 16, 2019, 12:58pm UTC](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944/40 "2019-03-16T12:58:24Z")

</div>

Keep up the good work @roshii. I’m enjoying these updates 🙂

[Previous page](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944.md?page=1)

[Next page](https://discourse.julialang.org/t/in-development-bitcoin-jl-a-julia-bitcoin-library/17944.md?page=3)
