Author

Topic: NBitcoin : How to scan the Blockchain (Read 1566 times)

sr. member
Activity: 406
Merit: 251
http://altoidnerd.com
June 16, 2014, 02:07:53 AM
#9
Can any badasses confirm this repo is safe? 
hero member
Activity: 714
Merit: 662
June 15, 2014, 06:59:04 AM
#8
Hey... nice development. Can I run my own block explorer using https://github.com/NicolasDorier/NBitcoin ? Will send/receive API be supported ?

Yes, you can code your own blockexplorer using it.
Actually I index only Blocks with the IndexedBlockStore, but nothing prevent you to index other data structure like transactions.

The class you will need for that is BlockStore, which permit you to enumerate the blocks in the blocks folder of bitcoind.
And SqlLiteNoSqlRepository, which permit you to have a persistent key-value store, to create your index.

You can send/receive with the NodeServer class, which permit to connect to bitcoin network send transactions, and receive transactions, with raw protocol messages.
You can also use RPCClient which would connect in RPC to bitcoind, that would send transaction on your behalf, this is recommended because NBitcoin can't verify that inputs are not already spent.

NBitcoin is not a full node implementation, that means that it is unable to verify validity of a transaction. (precisely, it can't verify that inputs of your transaction are not already spent)

This is why I recommend to have a running bitcoind that verify transactions, but using the tracking abilities of NBitcoin (Scanners) from NBitcoin.
legendary
Activity: 2226
Merit: 1052
June 15, 2014, 05:16:03 AM
#7
Hey... nice development. Can I run my own block explorer using https://github.com/NicolasDorier/NBitcoin ? Will send/receive API be supported ?
hero member
Activity: 714
Merit: 662
June 15, 2014, 05:00:02 AM
#6
reading so far, looks like you did a nice job... i'm abit slow lol so i have to read a few setanes a couple of times.
I have some questions thoigh.. should I PM you or ask in thread ?
Ask in this thread if you have some question, other will also have and maybe I missed to explain something in the article.
legendary
Activity: 910
Merit: 1000
★YoBit.Net★ 350+ Coins Exchange & Dice
June 14, 2014, 09:24:59 PM
#5
reading so far, looks like you did a nice job... i'm abit slow lol so i have to read a few setanes a couple of times.
I have some questions thoigh.. should I PM you or ask in thread ?
member
Activity: 66
Merit: 10
June 14, 2014, 08:07:43 PM
#4
Good job, Nicolas.
hero member
Activity: 714
Merit: 662
June 14, 2014, 04:04:39 PM
#3
Thanks, added a part "manual scanning" if it interest you. Smiley
newbie
Activity: 45
Merit: 0
June 12, 2014, 12:24:00 PM
#2
I liked it
hero member
Activity: 714
Merit: 662
June 10, 2014, 10:13:15 AM
#1
I just published an article on NBitcoin http://www.codeproject.com/Articles/784519/NBitcoin-How-to-scan-the-Blockchain
I introduce a design of blockchain scanner that is easily extensible for tracking colored coins, multi sig, stealth address and more.

It actually works with the full blockchain dump of Bitcoin QT (BlkXXX.dat), but will very soon be extended to support SPV.

Waiting for your feedback !

Preview :
Quote
The previous article I wrote about bitcoin (Introduction article and one about stealth address and two factor), I did not invent anything special, I just wanted to explain in simpler term how things work.

On the other hand, this article propose a simple and scalable design to scan a blockchain, that work for full Bitcoin node and (soon) SPV.
I entirely made up this design, and it is experimental for now, and expect some bugs lurking around despite the 100+ unit tests I wrote. I expect you will use it and give me feedback about it.

Being experimental, the code of this article might have changed since I wrote it. But the general principle stays the same.

For people that knows how bitcoin works, you can skip the “Bitcoin Basics” part.
Jump to: