Author

Topic: How to get started writing a Bitcoin application? (Read 3196 times)

legendary
Activity: 3472
Merit: 4801
This may be a stupid question, but how does a wallet like MultiBit get updated and send/recieve transactions? Blockchain.info, I guess?

MultiBit uses SPV (Simplified Payment Verification)

https://en.bitcoin.it/wiki/Thin_Client_Security#Simplified_Payment_Verification_.28SPV.29

It connects directly to other peers on the network (just like Bitcoin-Qt does). It downloads a complete copy of the headers for all blocks in the entire blockchain. This means that the download and storage requirements scale linearly with the amount of time since bitcoin was invented; it would be preferable to have the scaling be logarithmic or even constant.

This scheme is described in section 8 of the original bitcoin whitepaper

newbie
Activity: 53
Merit: 0
This may be a stupid question, but how does a wallet like MultiBit get updated and send/recieve transactions? Blockchain.info, I guess?
newbie
Activity: 28
Merit: 0
Er, why? I don't know of any hosting providers that would stop you running a Bitcoin node. If you can run software on your host, you can run a full node.

Because configuring a bitcoind node and coding applications against the JSON-RPC API isn't easy for a first-time Bitcoin developer.

Do you really expect *every* developer to become an expert in `createrawtransaction`?

Honestly, yes. If you want to write a "bitcoin application" you should really learn how to properly do things relating to bitcoin before you go and make a full app.

newbie
Activity: 5
Merit: 0
Well, I would suggest using what is already available open source. No sense reinventing the wheel.

There are already tonnes of open source, free, effective products available:

Storefront - Magento, community (open source version).

Use Bitpay (or many other) merchange bitcoin gateways to learn and watch how the bitcoin payment interface works with the storefront.

Since we're talking PHP, python and of course C/C# etc, you can delve into the sourcecode if you wish to start making changes you need.

From there, you develop and replace the payment gateway to your own code.

In terms of just setting up basic jsonRPC's.. there are a few tutorials that go through it all online. Send me a PM if you'd like some links for it.

Cheers/
Lelantos.


full member
Activity: 142
Merit: 100
Hive/Ethereum
Because configuring a bitcoind node and coding applications against the JSON-RPC API isn't easy for a first-time Bitcoin developer.

Do you really expect *every* developer to become an expert in `createrawtransaction`?

If a developer doesn't have the skills to code applications against the JSON-RPS API, then they really shouldn't be trying create something that handles money.  The odds are better than not that they will eventually be hacked and lose any bitcoins they are holding.

This is not even remotely close to a fair statement. If it were, companies like Braintree wouldn't exist.

You're saying the the developers that created braintree don't have the skills to code applications against an API???

Because of companies like Braintree, you don't have to be a payment expert just to work with money. BitPay and Coinbase offer basic merchant tools, but if you want to do anything more creative than that, there's not much out there to help you.

As I mentioned in my previous post, configuring and writing applications against bitcoind isn't easy, even if you're a JSON-RPC expert. That's because JSON-RPC isn't the barrier to entry for developers. Bitcoind's idiosyncrasies are.
legendary
Activity: 3472
Merit: 4801
Because configuring a bitcoind node and coding applications against the JSON-RPC API isn't easy for a first-time Bitcoin developer.

Do you really expect *every* developer to become an expert in `createrawtransaction`?

If a developer doesn't have the skills to code applications against the JSON-RPS API, then they really shouldn't be trying create something that handles money.  The odds are better than not that they will eventually be hacked and lose any bitcoins they are holding.

This is not even remotely close to a fair statement. If it were, companies like Braintree wouldn't exist.

You're saying the the developers that created braintree don't have the skills to code applications against an API???
full member
Activity: 142
Merit: 100
Hive/Ethereum
Because configuring a bitcoind node and coding applications against the JSON-RPC API isn't easy for a first-time Bitcoin developer.

Do you really expect *every* developer to become an expert in `createrawtransaction`?

If a developer doesn't have the skills to code applications against the JSON-RPS API, then they really shouldn't be trying create something that handles money.  The odds are better than not that they will eventually be hacked and lose any bitcoins they are holding.

This is not even remotely close to a fair statement. If it were, companies like Braintree wouldn't exist.
full member
Activity: 154
Merit: 100
Ice-Dice.com | Massive Referral Bonus!
Here are few a good place to get you started.

https://en.bitcoin.it/wiki/Running_Bitcoin
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)

Cheers feel free to PM me if you have any questions on working with Bitcoind
legendary
Activity: 1526
Merit: 1134
Brutal but true. Also you shouldn't need to use createrawtransaction for the vast majority of apps.
legendary
Activity: 3472
Merit: 4801
Because configuring a bitcoind node and coding applications against the JSON-RPC API isn't easy for a first-time Bitcoin developer.

Do you really expect *every* developer to become an expert in `createrawtransaction`?

If a developer doesn't have the skills to code applications against the JSON-RPS API, then they really shouldn't be trying create something that handles money.  The odds are better than not that they will eventually be hacked and lose any bitcoins they are holding.
newbie
Activity: 56
Merit: 0
I am also very interested this.
full member
Activity: 142
Merit: 100
Hive/Ethereum
Er, why? I don't know of any hosting providers that would stop you running a Bitcoin node. If you can run software on your host, you can run a full node.

Because configuring a bitcoind node and coding applications against the JSON-RPC API isn't easy for a first-time Bitcoin developer.

Do you really expect *every* developer to become an expert in `createrawtransaction`?
legendary
Activity: 1526
Merit: 1134
Er, why? I don't know of any hosting providers that would stop you running a Bitcoin node. If you can run software on your host, you can run a full node.

If your host limits you to pure PHP or whatever then just get a real VPS instead. Web only hosting plans are long since obsolete.
full member
Activity: 142
Merit: 100
Hive/Ethereum
Are you looking for something like this?  https://bitcointalksearch.org/topic/m.3129490
legendary
Activity: 817
Merit: 1000
Why don't you want to run bitcoind locally? You can't afford the 10 gigs or so of disk space? Is that really the bottleneck for your project?

You can use bitcoinj to do this as well. It's a Java library but should be usable with .NET via IKVM. I haven't tried that myself but I guess it should work as bitcoinj is relatively boring plain old Java 1.6.

If you use bitcoinj you have options - you can either connect it directly to the P2P network, which gives you a lower level of security (SPV level), or you can connect it to a bitcoind that's running locally, in which case your security level is the highest possible. If you start out by thinking you don't want to run a Bitcoin node, and later decide actually you can afford it after all, it's very easy to switch modes. If you use blockchain.info or some other third-party specific API, then you're out of luck.

So - it's really best to not rely on third party services if you can avoid it. Using a local bitcoind and keeping it up to date is unlikely to be the hardest or most expensive part of your project - don't end up with premature optimisations.

I may be wrong but I would think that in order to run a full node I may run into a lot of problems and limitations when it comes to finding a hosting provider.
legendary
Activity: 2142
Merit: 1010
Newbie
Only one double transaction.

It's a very serious bug. When I experienced such the bug it was pure luck that the funds were sent to a honest person, otherwise I wouldn't get them back.
hero member
Activity: 765
Merit: 503
I have some ideas for a few web services I would like to try and code up in my free time but I am having a hard time figuring out how to get started.

Basically I want to start by figuring out how to create a website that can create Bitcoin addresses and will allow me to send/receive coins. Initially I am going to do this using C# as I am most comfortable with it. Is the only way to write a Bitcoin application to have the QT client and execute RPC commands? Are there easier ways to do this like somehow using a more lightweight client like Electrum and executing commands through it? I don't want to have to keep an entire copy of the blockchain if possible. If I was to deploy such a website would I need to install the QT and blockchain on my hosting space?

Are there any getting started guides for this sort of thing? I would of course like to learn the proper security practices around hosting a Bitcoin wallet securely.

Edit: I've found that blockchain.info appears to have an API that may suit my needs: https://blockchain.info/api/json_rpc_api
What are the drawbacks of using a system such as this? Let's say I was to write an app that uses this and it became something widely used, will I have shot myself in the foot in some way by using such a third party service instead of rolling my own?

Edit2: It appears blockchain needs to be aware of your private key in order the sign the transactions which would probably be considered unacceptable.

U should use QT. 3rd party services are unreliable. I used BlockChain.Info API and had negative experience due to their bugs (delayed notifications, double transactions).
Here is my Java-bot that uses QT, u can easily convert it into C# - https://bitcointalksearch.org/topic/yet-another-martingale-bot-for-satoshidice-java-app-117640

I disagree.  I have run over 2500 transactions via block chain.info.  Only one double transaction.  A bit of lag, but thats nothing to do with them.

On the other hand, running qt in daemon mode and interfacing with c# roc calls was totally unreliable.  Would crash in hourly.

Check out my coinjar.net project on github which has a similar api.  I also have a version for blockchain info im willing to share.  Last tip, look at bitsharp on github.  I might be joining that team soon.
legendary
Activity: 1526
Merit: 1134
Why don't you want to run bitcoind locally? You can't afford the 10 gigs or so of disk space? Is that really the bottleneck for your project?

You can use bitcoinj to do this as well. It's a Java library but should be usable with .NET via IKVM. I haven't tried that myself but I guess it should work as bitcoinj is relatively boring plain old Java 1.6.

If you use bitcoinj you have options - you can either connect it directly to the P2P network, which gives you a lower level of security (SPV level), or you can connect it to a bitcoind that's running locally, in which case your security level is the highest possible. If you start out by thinking you don't want to run a Bitcoin node, and later decide actually you can afford it after all, it's very easy to switch modes. If you use blockchain.info or some other third-party specific API, then you're out of luck.

So - it's really best to not rely on third party services if you can avoid it. Using a local bitcoind and keeping it up to date is unlikely to be the hardest or most expensive part of your project - don't end up with premature optimisations.
legendary
Activity: 2142
Merit: 1010
Newbie
I have some ideas for a few web services I would like to try and code up in my free time but I am having a hard time figuring out how to get started.

Basically I want to start by figuring out how to create a website that can create Bitcoin addresses and will allow me to send/receive coins. Initially I am going to do this using C# as I am most comfortable with it. Is the only way to write a Bitcoin application to have the QT client and execute RPC commands? Are there easier ways to do this like somehow using a more lightweight client like Electrum and executing commands through it? I don't want to have to keep an entire copy of the blockchain if possible. If I was to deploy such a website would I need to install the QT and blockchain on my hosting space?

Are there any getting started guides for this sort of thing? I would of course like to learn the proper security practices around hosting a Bitcoin wallet securely.

Edit: I've found that blockchain.info appears to have an API that may suit my needs: https://blockchain.info/api/json_rpc_api
What are the drawbacks of using a system such as this? Let's say I was to write an app that uses this and it became something widely used, will I have shot myself in the foot in some way by using such a third party service instead of rolling my own?

Edit2: It appears blockchain needs to be aware of your private key in order the sign the transactions which would probably be considered unacceptable.

U should use QT. 3rd party services are unreliable. I used BlockChain.Info API and had negative experience due to their bugs (delayed notifications, double transactions).
Here is my Java-bot that uses QT, u can easily convert it into C# - https://bitcointalksearch.org/topic/yet-another-martingale-bot-for-satoshidice-java-app-117640
legendary
Activity: 817
Merit: 1000
I have some ideas for a few web services I would like to try and code up in my free time but I am having a hard time figuring out how to get started.

Basically I want to start by figuring out how to create a website that can create Bitcoin addresses and will allow me to send/receive coins. Initially I am going to do this using C# as I am most comfortable with it. Is the only way to write a Bitcoin application to have the QT client and execute RPC commands? Are there easier ways to do this like somehow using a more lightweight client like Electrum and executing commands through it? I don't want to have to keep an entire copy of the blockchain if possible. If I was to deploy such a website would I need to install the QT and blockchain on my hosting space?

Are there any getting started guides for this sort of thing? I would of course like to learn the proper security practices around hosting a Bitcoin wallet securely.

Edit: I've found that blockchain.info appears to have an API that may suit my needs: https://blockchain.info/api/json_rpc_api
What are the drawbacks of using a system such as this? Let's say I was to write an app that uses this and it became something widely used, will I have shot myself in the foot in some way by using such a third party service instead of rolling my own?

Edit2: It appears blockchain needs to be aware of your private key in order the sign the transactions which would probably be considered unacceptable.
Jump to: