Bitcoin Forum
April 26, 2024, 12:00:16 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to get started writing a Bitcoin application?  (Read 3177 times)
_mr_e (OP)
Legendary
*
Offline Offline

Activity: 817
Merit: 1000



View Profile
September 22, 2013, 05:36:49 PM
Last edit: September 22, 2013, 06:00:36 PM by _mr_e
 #1

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.
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714132816
Hero Member
*
Offline Offline

Posts: 1714132816

View Profile Personal Message (Offline)

Ignore
1714132816
Reply with quote  #2

1714132816
Report to moderator
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
September 22, 2013, 09:01:04 PM
 #2

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://bitcointalk.org/index.php?topic=117640.0
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
September 23, 2013, 08:36:50 AM
 #3

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.
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
September 23, 2013, 10:50:47 AM
 #4

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://bitcointalk.org/index.php?topic=117640.0

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.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
September 23, 2013, 11:03:37 AM
 #5

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.
_mr_e (OP)
Legendary
*
Offline Offline

Activity: 817
Merit: 1000



View Profile
September 24, 2013, 04:24:13 PM
 #6

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.
tgerring
Full Member
***
Offline Offline

Activity: 142
Merit: 100


Hive/Ethereum


View Profile WWW
September 25, 2013, 12:36:19 AM
 #7

Are you looking for something like this?  https://bitcointalk.org/index.php?topic=289998.msg3129490#msg3129490

Hive, a beautiful wallet for Mac OS X, now available for testing. Follow the story here.
BitcoinKit.framework and Tor.framework, now available to iOS and Mac OS X developers
Tweeting at @hivewallet. Donations appreciated at 142m1MpXHhymF4aASiWwYohe1Y55v5BQwc
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
September 25, 2013, 08:16:46 AM
 #8

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.
tgerring
Full Member
***
Offline Offline

Activity: 142
Merit: 100


Hive/Ethereum


View Profile WWW
September 25, 2013, 12:28:33 PM
 #9

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`?

Hive, a beautiful wallet for Mac OS X, now available for testing. Follow the story here.
BitcoinKit.framework and Tor.framework, now available to iOS and Mac OS X developers
Tweeting at @hivewallet. Donations appreciated at 142m1MpXHhymF4aASiWwYohe1Y55v5BQwc
pengcqu
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
September 25, 2013, 01:50:43 PM
 #10

I am also very interested this.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



View Profile
September 25, 2013, 07:23:44 PM
 #11

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.
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1128


View Profile
September 25, 2013, 08:41:31 PM
 #12

Brutal but true. Also you shouldn't need to use createrawtransaction for the vast majority of apps.
icedicedavid
Full Member
***
Offline Offline

Activity: 154
Merit: 100


Ice-Dice.com | Massive Referral Bonus!


View Profile WWW
September 25, 2013, 11:17:46 PM
 #13

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

tgerring
Full Member
***
Offline Offline

Activity: 142
Merit: 100


Hive/Ethereum


View Profile WWW
September 26, 2013, 03:20:03 PM
 #14

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.

Hive, a beautiful wallet for Mac OS X, now available for testing. Follow the story here.
BitcoinKit.framework and Tor.framework, now available to iOS and Mac OS X developers
Tweeting at @hivewallet. Donations appreciated at 142m1MpXHhymF4aASiWwYohe1Y55v5BQwc
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



View Profile
September 26, 2013, 04:34:17 PM
 #15

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???
tgerring
Full Member
***
Offline Offline

Activity: 142
Merit: 100


Hive/Ethereum


View Profile WWW
September 26, 2013, 04:57:35 PM
 #16

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.

Hive, a beautiful wallet for Mac OS X, now available for testing. Follow the story here.
BitcoinKit.framework and Tor.framework, now available to iOS and Mac OS X developers
Tweeting at @hivewallet. Donations appreciated at 142m1MpXHhymF4aASiWwYohe1Y55v5BQwc
lelantos
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile WWW
September 27, 2013, 08:26:01 PM
 #17

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.


dope
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
October 09, 2013, 12:35:26 AM
 #18

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.

somatic
Newbie
*
Offline Offline

Activity: 53
Merit: 0


View Profile WWW
October 12, 2013, 09:26:04 AM
 #19

This may be a stupid question, but how does a wallet like MultiBit get updated and send/recieve transactions? Blockchain.info, I guess?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



View Profile
October 12, 2013, 11:15:38 AM
 #20

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

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!