Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: mb300sd on March 01, 2013, 08:52:03 PM



Title: C# Bitcoin-Tool, variety of uses.
Post by: mb300sd on March 01, 2013, 08:52:03 PM
https://github.com/mb300sd/Bitcoin-Tool/

Code:
Bitcoin-Tool
============

Collection of bitcoin related classes, can be used to impliment
a variety of functions.

* Work with addresses, public and private keys
* Generate and sign transactions
* Connect over P2P to a bitcoin node
* Easily generate and evaulate custom scripts
* Decode and encode blocks, transactions, scripts, network messages
* Parse blockchain for data

Program.cs contains test code/me playing around/etc and usually contains
commented out code that can be used for examples.
I wrote this mostly as a learning exercise and added more out of boredom.
No particular goal with this other than experimenting. Any interesting/fun suggestions might get written.


Title: Re: C# Bitcoin-Tool, variety of uses.
Post by: Stephen Gornick on March 02, 2013, 03:49:21 AM
Any interesting/fun suggestions might get written.

Any desire to have it read a wallet.dat?

Here's a resource on that:
 - http://bitcoin.stackexchange.com/a/849/153


Title: Re: C# Bitcoin-Tool, variety of uses.
Post by: Insu Dra on March 03, 2013, 11:06:58 AM
Interesting, definitely some classes in there that can save me some time and trouble. license ?


Title: Re: C# Bitcoin-Tool, variety of uses.
Post by: mb300sd on March 05, 2013, 08:42:56 PM
Interesting, definitely some classes in there that can save me some time and trouble. license ?

dunno, lets say gpl for now

Any interesting/fun suggestions might get written.

Any desire to have it read a wallet.dat?

Here's a resource on that:
 - http://bitcoin.stackexchange.com/a/849/153

I've read somewhere that the devs are moving away from BDB for wallet.dat soon. I'll probably hold off for now.


Title: Re: C# Bitcoin-Tool, variety of uses.
Post by: mb300sd on March 08, 2013, 05:05:34 PM
Couple updates..

Wrote some code that computes the unspent TxOut set, and calculates the balances of all addresses.

https://github.com/mb300sd/Bitcoin-Tool/tree/master/Bitcoin%20Tool/Apps

This is getting pretty close to becoming a lite client. I'll probably write network downloading of new blocks and updating of the utxo set as soon as I figure out how to handle orphaned blocks.

I'm working on a custom transaction gui tool that will use the unspent output database, transaction creation, and broadcast functionality.


Title: Re: C# Bitcoin-Tool, variety of uses.
Post by: swordfish6975 on June 27, 2013, 12:56:40 PM
when generating the utxo.dat it only looks at blk00000.dat

should it look at all the blk0000XX.dat files?



fs.Position is equal fs.Length (link (https://github.com/mb300sd/Bitcoin-Tool/blob/master/Bitcoin%20Tool/Util/BlockFileReader.cs#L20)) at the end of the blk00000.dat so it returns null and then goes on to write out the utxo.dat  (128mb) with only the data from blk00000.dat


Edit: I modified the code and got it working, the data now matches blockchain.info


Title: Re: C# Bitcoin-Tool, variety of uses.
Post by: qualalol on June 27, 2013, 01:23:58 PM
Interesting, definitely some classes in there that can save me some time and trouble. license ?

dunno, lets say gpl for now

If you want people to actually be able to use it you'll need to put the license on Github, e.g. with GPL you need to supply a copy of the gpl, and should add headers to the file just to make things clear (See https://www.gnu.org/licenses/gpl-3.0.html ). Without clear licensing no responsible developer will touch the code with a bargepole. (GPL is a fairly safe first choice -- all improvements have to be rereleased as source code, and you can always switch to more permissive licences later should you wish.)


Title: Re: C# Bitcoin-Tool, variety of uses.
Post by: slothbag on September 18, 2013, 12:11:24 PM
Thanks for the library mb300sd.  It's been a big help for me..

I see you already have sign & verify for transactions, do you think you could add message signing & verification like in bitcoin-qt?

I got as far as adding the "Magic String", double SHA256 hashing the data and then ECDSA signing it.. but the ECKey.recoverFromSignature part has me stumped. (i'm comparing to bitoinj).

Willing to pay 1 BTC for it :)