ATC777 (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 09, 2013, 09:27:07 PM |
|
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--
|
Epic Coinage -- Gold, Silver, Bitcoin, Exchange, Apparel, Electronics and more! Check the official trade thread for full list of products and services! Tips :: 13M9QLc5BDQe2iuB1N3Br58fYvJF5ixihT
|
|
|
ATC777 (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 09, 2013, 09:31:14 PM |
|
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.
|
Epic Coinage -- Gold, Silver, Bitcoin, Exchange, Apparel, Electronics and more! Check the official trade thread for full list of products and services! Tips :: 13M9QLc5BDQe2iuB1N3Br58fYvJF5ixihT
|
|
|
weex
Legendary
Offline
Activity: 1102
Merit: 1014
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 09, 2013, 09:51:59 PM |
|
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.
|
|
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 01:08:21 AM |
|
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](https://bitcointalk.org/Smileys/default/smiley.gif)
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
|
ATC777 (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 01:56:10 AM |
|
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.
|
Epic Coinage -- Gold, Silver, Bitcoin, Exchange, Apparel, Electronics and more! Check the official trade thread for full list of products and services! Tips :: 13M9QLc5BDQe2iuB1N3Br58fYvJF5ixihT
|
|
|
ATC777 (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 07:40:05 AM |
|
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: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F6472%2Fminercalc.jpg&t=665&c=RPcXRIadLBKL5g) 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](https://bitcointalk.org/Smileys/default/cheesy.gif) --ATC--
|
Epic Coinage -- Gold, Silver, Bitcoin, Exchange, Apparel, Electronics and more! Check the official trade thread for full list of products and services! Tips :: 13M9QLc5BDQe2iuB1N3Br58fYvJF5ixihT
|
|
|
Atruk
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 06:00:10 PM |
|
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: ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fanonymouse.org%2Fcgi-bin%2Fanon-www.cgi%2Fhttp%3A%2F%2Fimg217.imageshack.us%2Fimg217%2F6472%2Fminercalc.jpg&t=665&c=gl5yykccZ0FFsw) 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](https://bitcointalk.org/Smileys/default/cheesy.gif) --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.
|
|
|
|
ATC777 (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 06:06:05 PM |
|
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).
|
Epic Coinage -- Gold, Silver, Bitcoin, Exchange, Apparel, Electronics and more! Check the official trade thread for full list of products and services! Tips :: 13M9QLc5BDQe2iuB1N3Br58fYvJF5ixihT
|
|
|
Atruk
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 06:18:55 PM |
|
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.
|
|
|
|
ATC777 (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 06:38:57 PM |
|
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](https://bitcointalk.org/Smileys/default/cool.gif) 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](https://bitcointalk.org/Smileys/default/cheesy.gif)
|
Epic Coinage -- Gold, Silver, Bitcoin, Exchange, Apparel, Electronics and more! Check the official trade thread for full list of products and services! Tips :: 13M9QLc5BDQe2iuB1N3Br58fYvJF5ixihT
|
|
|
Atruk
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 10, 2013, 07:02:42 PM |
|
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](https://bitcointalk.org/Smileys/default/cheesy.gif) 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.
|
|
|
|
|