Author

Topic: Some programming questions (Read 1277 times)

hero member
Activity: 700
Merit: 500
January 10, 2013, 02:02:42 PM
#13
Perhaps I can put some financial incentive in it which would definitely make me work fast and furious. I'll make it freeware with the "pay what you want" concept and a suggested donation of around 0.70 BTC (close to $10). I have no moral problem with proprietary software (in fact, been developing it for years) but I think making this free to use would be "in the spirit of Bitcoin", and a great way for our new company (and me, personally) to contribute to Bitcoin and the community. But do you think it would actually work, or would people just download it and say "eff that ATC guy!"? lol...

As far as general tips if you decide to develop a client go, it is hard to go wrong if you use bitcoind to handle the networking on a full client or an electrum server (it'd probably be polite to set up your own for testing your software on during development) if you go the light route.

Thanks for the suggestions. I'll be looking into this more quite soon. But I can't let myself get too many simultaneous development projects going on! Believe me, I can really get carried away! Cheesy

Donations aren't something to count on, but if you could produce a web version either as your primary, or as a demonstration that could get whatever site you put it on quite a bit of traffic. Traffic brings its own problems though. A charge of a bitcent, bitnickle, or bitdime to unlock some of the advanced functionality though might bring in more revenue than a higher charge or suggested donation. If we've learned anything from mobile app land, lots of small purchases make more money than a few big ones in a lot of cases.

If you worry about getting carried away just remember that it is okay to let dead end projects die. It is alright to start a bunch of small projects to learn aspects of how bitcoin works and then kill the small ones to focus on a few you find interesting or potentially lucrative. Rather than trying to make a single big project at the outset instead make features that let you learn and practice, which might be useful incorporated into a project.
member
Activity: 112
Merit: 10
January 10, 2013, 01:38:57 PM
#12
That sounds great. The second one especially sounds interesting. I think it would be useful to be able to input an algebraic expression as well for an anticipated growth rate. It would be nice to have a quick GUI option as opposed to beating up my keyboard while I use Python as a calculator.

Chip profiles or rig profiles that can be saved is a cool idea as well.

I like those ideas too. Can't let myself get carried away with the infamous "feature creep", but keep the ideas rolling!  Cool

There are a lot of really basic and not so basic mining calculators out there, but putting together a nice one with advanced functionality like you are thinking about is probably going to net you some positive attention if you can pull it off.

Definitely. The question is will I do it... Hopefully. But I've got a lot of stuff going on (e.g., getting a start-up off the ground, primarily) and gotta put food on the table and keep the lights on, haha.

Perhaps I can put some financial incentive in it which would definitely make me work fast and furious. I'll make it freeware with the "pay what you want" concept and a suggested donation of around 0.70 BTC (close to $10). I have no moral problem with proprietary software (in fact, been developing it for years) but I think making this free to use would be "in the spirit of Bitcoin", and a great way for our new company (and me, personally) to contribute to Bitcoin and the community. But do you think it would actually work, or would people just download it and say "eff that ATC guy!"? lol...

As far as general tips if you decide to develop a client go, it is hard to go wrong if you use bitcoind to handle the networking on a full client or an electrum server (it'd probably be polite to set up your own for testing your software on during development) if you go the light route.

Thanks for the suggestions. I'll be looking into this more quite soon. But I can't let myself get too many simultaneous development projects going on! Believe me, I can really get carried away! Cheesy
hero member
Activity: 700
Merit: 500
January 10, 2013, 01:18:55 PM
#11
One useful thing a lot of mining calculators lack is a way to calculate returns relative to difficulty increases over time. The more ways you allow inputting this the better.

That's one thing I'm putting a lot of thought into. I will of course provide some simple methods for calculating difficulty increase, like annual % increase, annual hash-power increase and perhaps even post-ASIC difficulty estimates (could use some help there).

But what I'd really like to do is create a difficulty curve on a graph that can be adjusted over a user-specified time scale by clicking and dragging or manually inserting control points. It would allow people considering a serious/professional mining operation to create customized difficulty profiles for the network and calculate the effectiveness of different equipment to fit it.

That sounds great. The second one especially sounds interesting. I think it would be useful to be able to input an algebraic expression as well for an anticipated growth rate. It would be nice to have a quick GUI option as opposed to beating up my keyboard while I use Python as a calculator.

Chip profiles or rig profiles that can be saved is a cool idea as well.

There are a lot of really basic and not so basic mining calculators out there, but putting together a nice one with advanced functionality like you are thinking about is probably going to net you some positive attention if you can pull it off.

As far as general tips if you decide to develop a client go, it is hard to go wrong if you use bitcoind to handle the networking on a full client or an electrum server (it'd probably be polite to set up your own for testing your software on during development) if you go the light route.
member
Activity: 112
Merit: 10
January 10, 2013, 01:06:05 PM
#10
One useful thing a lot of mining calculators lack is a way to calculate returns relative to difficulty increases over time. The more ways you allow inputting this the better.

That's one thing I'm putting a lot of thought into. I will of course provide some simple methods for calculating difficulty increase, like annual % increase, annual hash-power increase and perhaps even post-ASIC difficulty estimates (could use some help there).

But what I'd really like to do is create a difficulty curve on a graph that can be adjusted over a user-specified time scale by clicking and dragging or manually inserting control points. It would allow people considering a serious/professional mining operation to create customized difficulty profiles for the network and calculate the effectiveness of different equipment to fit it.

I think I might also add a feature where you can add different chip profiles. For instance, you might create a profile for the HD 7970 and one for the 5970 and adjust the number of each you have, and it will make calculations as a total of all your equipment. Furthermore, perhaps I should also add a field for something like "auxiliary power consumption" so people can also account for the power-sucking effect of other devices they need to run their rigs (e.g., CPU, mobo, etc).
hero member
Activity: 700
Merit: 500
January 10, 2013, 01:00:10 PM
#9
Just for giggles I'm currently working on what will be a very accurate and detailed mining calculator... with some refinements in the future it might be good enough for professional use (maybe...if I take it seriously). Right now I'm just writing the UI code, wiring up events and designing the thing. Here's a screenie of what it looks like right now:



If you have any suggestions on how I should design it or technical/logical suggestions on making it more accurate I'm all ears!  Cheesy

--ATC--

One useful thing a lot of mining calculators lack is a way to calculate returns relative to difficulty increases over time. The more ways you allow inputting this the better.
member
Activity: 112
Merit: 10
January 10, 2013, 02:40:05 AM
#8
Just for giggles I'm currently working on what will be a very accurate and detailed mining calculator... with some refinements in the future it might be good enough for professional use (maybe...if I take it seriously). Right now I'm just writing the UI code, wiring up events and designing the thing. Here's a screenie of what it looks like right now:



If you have any suggestions on how I should design it or technical/logical suggestions on making it more accurate I'm all ears!  Cheesy

--ATC--
member
Activity: 112
Merit: 10
January 09, 2013, 08:56:10 PM
#7
If you haven't read this, do it before you do anything else:
http://www.bitcoin.org/bitcoin.pdf

That's the Satoshi whitepaper link, isn't it?

If so, I have indeed downloaded it and started reading it a few days ago. Just haven't gotten very deep yet.
legendary
Activity: 1904
Merit: 1002
January 09, 2013, 08:13:42 PM
#6
If you haven't read this, do it before you do anything else:
http://www.bitcoin.org/bitcoin.pdf
kjj
legendary
Activity: 1302
Merit: 1026
January 09, 2013, 08:08:21 PM
#5
I'm working on some Bitcoin-related software and had a few questions... FYI, I'm using C++ and C#...

1) Where can I find information/guidelines/tutorials for connecting to the Bitcoin network?
2) What's the easiest way to get the current mining difficulty from the network?
3) Is there a simple open-source BTC client written in C# I can have a look at and dissect?
4) Are their any "best practices" articles about programming for Bitcoin?

More information would be very useful when answering you.  For example, in question 1, are you asking what it takes to make a program that talks to other bitcoin nodes using the p2p protocol?  If so, the network information can be found here.  Actually getting connected isn't too bad.  You connect the socket, go through the version/verack handshake, and you are on.  After that, it is just a matter of not doing anything that make the other side think it needs to disconnect you.

For #2, "the network" doesn't know the difficulty.  Each node knows it, but there is no point in communicating it over the p2p socket, so there is no message for it.  However, if you grab the latest block from a node, that block header will have a target field, which you can use to calculate the difficulty.  Being sure that a given block is the "latest block" is not trivial.  Vastly easier is to just run a node somewhere, and use the getmininginfo RPC call.

#3 Not that I'm aware of.  The good news is that the reference client is open source.  Even better, it is also Free Software (MIT license).  The bad news is that it is C++.

#4 changes dramatically depending on what you really mean by "programming for Bitcoin".  If you are writing wallet/node software, the best practice (or only practice, really) is to go through the reference client with a microscope and faithfully recreate every wart, wrinkle and bug that you find in it.  If you are just looking to hook some stuff up using RPC, best practices will be vastly different, since the node you are RPCing to already manages the burden of validation and correctness.  In that case, the best practice is to use strings to represent amounts.  Smiley
vip
Activity: 756
Merit: 503
January 09, 2013, 04:56:20 PM
#4
You can get difficulty and market price information via Blockchain.info API: http://blockchain.info/api

You can also query MtGox or BTC-E API directly:

https://en.bitcoin.it/wiki/MtGox/API
https://btc-e.com/api/documentation
legendary
Activity: 1102
Merit: 1014
January 09, 2013, 04:51:59 PM
#3
Your best bet is to search the wiki. Also check out pynode which is in python but simple enough to get into for Bitcoin software. On mobile or else I'd postlinks . Good luck and welcome to Bitcoin.
member
Activity: 112
Merit: 10
January 09, 2013, 04:31:14 PM
#2
Also, where can I learn more about math behind Bitcoin mining, difficulty and SHA-256 in general? I would also like to know how I can fetch the "last" price from Mt Gox and/or BTC-E.
member
Activity: 112
Merit: 10
January 09, 2013, 04:27:07 PM
#1
I'm working on some Bitcoin-related software and had a few questions... FYI, I'm using C++ and C#...

1) Where can I find information/guidelines/tutorials for connecting to the Bitcoin network?
2) What's the easiest way to get the current mining difficulty from the network?
3) Is there a simple open-source BTC client written in C# I can have a look at and dissect?
4) Are their any "best practices" articles about programming for Bitcoin?

Thanks,

--ATC--
Jump to: