Bitcoin Forum
November 12, 2024, 07:35:26 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: NBitcoin : How to scan the Blockchain  (Read 1560 times)
Nicolas Dorier (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 662


View Profile
June 10, 2014, 03:13:15 PM
 #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.

Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
johnatan32
Newbie
*
Offline Offline

Activity: 45
Merit: 0


View Profile
June 12, 2014, 05:24:00 PM
 #2

I liked it
Nicolas Dorier (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 662


View Profile
June 14, 2014, 09:04:39 PM
 #3

Thanks, added a part "manual scanning" if it interest you. Smiley

Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
mcaizgk2
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
June 15, 2014, 01:07:43 AM
Last edit: August 22, 2014, 03:12:26 AM by mcaizgk2
 #4

Good job, Nicolas.
Justin00
Legendary
*
Offline Offline

Activity: 910
Merit: 1000


★YoBit.Net★ 350+ Coins Exchange & Dice


View Profile
June 15, 2014, 02:24:59 AM
 #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 ?

Nicolas Dorier (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 662


View Profile
June 15, 2014, 10: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.

Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
newIndia
Legendary
*
Offline Offline

Activity: 2226
Merit: 1052


View Profile
June 15, 2014, 10: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 ?

Nicolas Dorier (OP)
Hero Member
*****
Offline Offline

Activity: 714
Merit: 662


View Profile
June 15, 2014, 11: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.

Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
Altoidnerd
Sr. Member
****
Offline Offline

Activity: 406
Merit: 251


http://altoidnerd.com


View Profile WWW
June 16, 2014, 07:07:53 AM
 #9

Can any badasses confirm this repo is safe? 

Do you even mine?
http://altoidnerd.com 
12gKRdrz7yy7erg5apUvSRGemypTUvBRuJ
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!