<p>The easiest way if you come from web development and or you want to put a system in production is to use the most stable and updated implementation/API of Bitcoin Core</p>

<p>note: after downloading it it's best practice to check the md5/sha of the file you downloaded on bitcoin.org to be sure your installer is genuine</p>

<hr>

<p>1) Install Bitcoin Core </p>

<p>2) Use it's CLI or JSON rpc APIs: <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow">https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list</a></p>

<p>there's no step 3!</p>

<hr>

<p>This in the case your target is to run an app connected to most of the updated nodes, have the latest code with security fixes to at least sign and broadcast transactions, and obviously, query the blockchain!</p>

<p>glhf</p>

CC BY-SA 3.0
2015-09-12T15:44:14.230Z
2015-10-05T11:15:19.110Z
2015-10-05T11:15:19.110Z
makevoid
<p>You should looks at the existing C implementations (SPV node, incomplete):</p>

<ul>
<li><a href="https://github.com/jgarzik/picocoin" rel="nofollow">https://github.com/jgarzik/picocoin</a></li>
<li><a href="https://github.com/bit-c/bitc" rel="nofollow">https://github.com/bit-c/bitc</a></li>
</ul>

CC BY-SA 3.0
2015-09-12T09:57:03.030Z
Thank you for that information. Something even better would be just 40-50 lines of code doing some basic thing, like accepting blocks or smthn like that.
user2277550
CC BY-SA 3.0
2015-09-12T10:23:20.000Z
Accepting blocks means validating them, which is a huge amount of work and must be bit-for-bit identical with Bitcoin Core. It's not possible with a small codebase, or at least not for now until libbitcoinconcensus is stable.
Claris
CC BY-SA 3.0
2015-09-12T08:59:39.463Z
2015-09-12T08:59:39.463Z
Jonas Schnelli
<p>Depends on the area. In any case i suggest you to only use test network to avoid losing funds.</p>

<p>If you are interested about the crypto stuff, study how to turn random number  into wallet address, or how signatures are made.</p>

<p><a href="https://github.com/keeshux/basic-blockchain-programming" rel="nofollow">https://github.com/keeshux/basic-blockchain-programming</a></p>

CC BY-SA 3.0
2016-02-07T22:40:34.683Z
2016-02-07T22:40:34.683Z
Anlhord Smithson
<p>Whilst not C, libbitcoin is written in C++ and is a full implementation. It should let you do everything.</p>

<p>If you're not limited to C, bitpay has a very straightforward p2p library here: <a href="https://github.com/bitpay/bitcore-p2p" rel="nofollow">https://github.com/bitpay/bitcore-p2p</a></p>

<p>I do not accept the answer of using the RPC, since you have to use a whole other 30mb application just to get your data, and it's not a great start for a scalable application or learning the inner workings of the network. </p>

CC BY-SA 3.0
2015-09-13T16:39:51.793Z
2015-09-13T16:39:51.793Z
karimkorun
<p>I would like to write a very simple program in bitcoin. I thought a simple C program that accepts the mined blocks would be appropriate. So I assume, the program would open a socket connection to some fixed relay node and start accepting the blocks. Could someone show how it could be done. Thank you.</p>

<p>[Edit:] I have since discovered what is probably best suited for the purpose. There is a <a href="https://github.com/cdecker/pycoin" rel="nofollow">minimal bitcoin networking stack</a> implemented in python by Dr Christian Decker of ETH Zurich. It was used to gather results for some highly cited research papers on the bitcoin network but at the same time it is extremely readable too.</p>

<development>
A "Hello World" of bitcoin?
user2277550
# A "Hello World" of bitcoin?

(Asked by: username_0 on 2015-09-12)

I would like to write a very simple program in bitcoin. I thought a simple C program that accepts the mined blocks would be appropriate. So I assume, the program would open a socket connection to some fixed relay node and start accepting the blocks. Could someone show how it could be done. Thank you.

[Edit:] I have since discovered what is probably best suited for the purpose. There is a [minimal bitcoin networking stack](https://github.com/cdecker/pycoin) implemented in python by Dr Christian Decker of ETH Zurich. It was used to gather results for some highly cited research papers on the bitcoin network but at the same time it is extremely readable too.

**Tags:** development


---

## 4 answers

### Answer by username_1 on 2015-09-12. Score: 5

The easiest way if you come from web development and or you want to put a system in production is to use the most stable and updated implementation/API of Bitcoin Core

note: after downloading it it's best practice to check the md5/sha of the file you downloaded on bitcoin.org to be sure your installer is genuine

---

1) Install Bitcoin Core

2) Use it's CLI or JSON rpc APIs: <https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list>

there's no step 3!

---

This in the case your target is to run an app connected to most of the updated nodes, have the latest code with security fixes to at least sign and broadcast transactions, and obviously, query the blockchain!

glhf


---

### Answer by username_2 on 2015-09-12. Score: 1

You should looks at the existing C implementations (SPV node, incomplete):

* <https://github.com/jgarzik/picocoin>
* <https://github.com/bit-c/bitc>

> **Comments:**
> **username_0**: Thank you for that information. Something even better would be just 40-50 lines of code doing some basic thing, like accepting blocks or smthn like that.  
> **username_3**: Accepting blocks means validating them, which is a huge amount of work and must be bit-for-bit identical with Bitcoin Core. It's not possible with a small codebase, or at least not for now until libbitcoinconcensus is stable.  

---

### Answer by username_4 on 2016-02-07. Score: 0

Depends on the area. In any case i suggest you to only use test network to avoid losing funds.

If you are interested about the crypto stuff, study how to turn random number into wallet address, or how signatures are made.

<https://github.com/keeshux/basic-blockchain-programming>


---

### Answer by username_5 on 2015-09-13. Score: 0

Whilst not C, libbitcoin is written in C++ and is a full implementation. It should let you do everything.

If you're not limited to C, bitpay has a very straightforward p2p library here: <https://github.com/bitpay/bitcore-p2p>

I do not accept the answer of using the RPC, since you have to use a whole other 30mb application just to get your data, and it's not a great start for a scalable application or learning the inner workings of the network.


---

