Bitcoin Forum

Bitcoin => Wallet software => Topic started by: hhanh00 on January 21, 2015, 03:35:59 PM



Title: A minimal full node client in F#
Post by: hhanh00 on January 21, 2015, 03:35:59 PM
Bitcoin full node in F#
An alternative full node bitcoin implementation in F#. The source code is on GitHub and this documentation was generated directly from the code.

Introduction
This project is under development and currently in alpha stage. Generally speaking, writing a fully compliant bitcoin node is extremely hard - some think impossible. The Bitcoin project is experimental and grew organically. As a result, the Satoshi client is the de-factor standard. By far the most used client on the network, it dictates what should be accepted and what should be rejected. Even the slighest deviation can cause a fork and potential loss of funds. It should go without saying

Do not use this code in production when real funds are at stake.

A lot of effort has been put into aligning its behavior with the core client but nevertheless there are almost certainly bugs that could be exploited to cause it to deviate from the reference implementation.

That being said this code has been through the "official" block acceptance test and has run from extended period of time. It implements all the consensus rules including the bugs that are now included in the blockchain since the genesis of Bitcoin.

However, Bitcoin F# has fully validated the existing mainnet blockchain and passes all the integration tests including large reorg tests. It is also the only implementation in a functional language and comes under 2.5 kLOC, making it the smallest client too.

Refer to the project page at https://github.com/bitcoinfs/bitcoinfs and its associated documentation at http://bitcoinfs.github.io/bitcoinfs


Title: Re: A minimal full node client in F#
Post by: da2ce7 on January 24, 2015, 04:24:22 PM
Great Work!  ;D ;D

Have you picked a license for the code yet?


Title: Re: A minimal full node client in F#
Post by: da2ce7 on January 24, 2015, 04:25:34 PM
If you wish to have additional exposure, you could compose and send an email to the the Bitcoin Development Mailing List.


Title: Re: A minimal full node client in F#
Post by: hhanh00 on January 25, 2015, 10:51:38 AM
Thanks, I've added the GPL v3 license.


Title: Re: A minimal full node client in F#
Post by: iwilcox on January 25, 2015, 05:08:29 PM
It is also the only implementation in a functional language ...

Did Haskoin and Purecoin not reach full node status?  (Genuinely asking, never looked.)


Title: Re: A minimal full node client in F#
Post by: hhanh00 on January 25, 2015, 05:59:49 PM
I'm not sure but they seem to be focused on the client side: creating transactions, signing, getting transaction history, SPV, etc. Everything you need if you are connecting to a bitcoin core instance.


Title: Re: A minimal full node client in F#
Post by: iwilcox on January 25, 2015, 06:24:49 PM
I'm not sure but they seem to be focused on the client side: creating transactions, signing, getting transaction history, SPV, etc. Everything you need if you are connecting to a bitcoin core instance.

On looking (slightly) closer, Haskoin seems to be SPV; harder to tell with Purecoin; and besides, "full" is ill-defined so I guess it doesn't matter too much.

Anyway, it's interesting to see another functional approach; I like the brevity and your walkthrough especially.  Thanks for sharing! :)


Title: Re: A minimal full node client in F#
Post by: hhanh00 on February 01, 2015, 05:17:53 AM
The functional approach helped keep the code short but there are still a few nasty aspects specially with a headers-first approach.
It works great though. I've tested synchronizing from/to bitcoin core and spv wallets and I now use it to monitor my Electrum/Armory/BIP32 wallets in one place.