Author

Topic: Understand source code of bitcoin (Read 262 times)

newbie
Activity: 35
Merit: 0
January 30, 2018, 12:47:21 PM
#10
As i am new of this market and i have some knowledge of programing, i wish if i can understand :
The source code of bitcoin, where i can start, if there video or explain the code is better.
I have a lot of question, like what is the different between coins working in blockchain.



Bitcoin was originally written in C++, looks like satoshi was programing under a windows environment and not linux which was surprising to find out to me.

So for starters, you would need a very high level of C++ to even pretend to start looking at the code.

Once you have adquired an high level of C++, you will need an high level of cryptography to understand the context of what everything is doing and why.

Once you are good in both C++ and cryptography you will be able to look at the code yourself. No amount of youtube videos briefly explaining the code will help if you aren't versed in the programing language used for Bitcoin and cryptography.
Thanks for this information, from where i can understand cryptography ?


You don't need to learn that much about using cryptography, just hashes and digital signaures using the secp256k1 curve.

The wallet is encrypted but that's just a minor detail really as it doesn't have to be.

So you need to learn about the following :

sha256 hashes
ripemd160 hashes
How to create a keypair on the secp256k1 curve
Sign something (I suggest an sha256 hash of something) with an secp256k1 private key and then verify the signature with the public key

Once you know the above that covers pretty much all of the cryptographic primitives used and you can then start looking into how these functions are used inside Bitcoin.

I would suggest downloading a library like libsecp256k1 and writing some test programs do do the above.


Thanks, where i can find information about private key?
member
Activity: 210
Merit: 26
High fees = low BTC price
January 30, 2018, 07:36:14 AM
#9
How to create a keypair on the secp256k1 curve

Well I downloaded C# code "secp256k1.Core" but messageSigner.Verify(signedMessage); always returns false from the
test code so I gave in trying to see what went wrong and started to roll my own

https://bitcointalksearch.org/topic/how-do-i-calculate-the-exponent-for-publicprivate-keys-2849443

RSACryptoServiceProvider that comes with windows is not to be trusted I don't think

EDIT to add


I found the bug in secp256k1 that stopped the signature from Verifying and you just need to change
the code in MessageSignerVerifier from

var signedMessage = new SignedMessage(message, publicKey.GetBitcoinAddress(), signatureBytes);
to
var signedMessage = new SignedMessage(message, publicKey.GetBitcoinAddress(false), signatureBytes);

The project will work from VS.2010 on framework 4 if you copy the .cs files to a new  C#.dll project
if anyone is interested


legendary
Activity: 2097
Merit: 1070
January 30, 2018, 06:07:40 AM
#8
As i am new of this market and i have some knowledge of programing, i wish if i can understand :
The source code of bitcoin, where i can start, if there video or explain the code is better.
I have a lot of question, like what is the different between coins working in blockchain.



Bitcoin was originally written in C++, looks like satoshi was programing under a windows environment and not linux which was surprising to find out to me.

So for starters, you would need a very high level of C++ to even pretend to start looking at the code.

Once you have adquired an high level of C++, you will need an high level of cryptography to understand the context of what everything is doing and why.

Once you are good in both C++ and cryptography you will be able to look at the code yourself. No amount of youtube videos briefly explaining the code will help if you aren't versed in the programing language used for Bitcoin and cryptography.
Thanks for this information, from where i can understand cryptography ?


You don't need to learn that much about using cryptography, just hashes and digital signaures using the secp256k1 curve.

The wallet is encrypted but that's just a minor detail really as it doesn't have to be.

So you need to learn about the following :

sha256 hashes
ripemd160 hashes
How to create a keypair on the secp256k1 curve
Sign something (I suggest an sha256 hash of something) with an secp256k1 private key and then verify the signature with the public key

Once you know the above that covers pretty much all of the cryptographic primitives used and you can then start looking into how these functions are used inside Bitcoin.

I would suggest downloading a library like libsecp256k1 and writing some test programs do do the above.

newbie
Activity: 1
Merit: 0
January 29, 2018, 06:40:04 PM
#7
Everything is open source.
newbie
Activity: 35
Merit: 0
January 29, 2018, 06:09:41 PM
#6
Bitcoin is blockchain protocol (C++ and python implementations). "You must have a background about C++".
I learned from:https://bitcoin.stackexchange.com

python implementations ----> https://bitcointalksearch.org/topic/ann-pynode-simple-bitcoin-p2p-node-94645.
Mastering Bitcoin [Reading]------> http://chimera.labs.oreilly.com/books/1234000001802/index.html
Youtube ------> https://www.youtube.com/watch?v=fOMVZXLjKYo
Online ------> https://bitcoin.stackexchange.com
you can ask here or reddit.com





Hugeblack
Very thanks, links is very useful.
newbie
Activity: 35
Merit: 0
January 29, 2018, 05:57:28 PM
#5
As i am new of this market and i have some knowledge of programing, i wish if i can understand :
The source code of bitcoin, where i can start, if there video or explain the code is better.
I have a lot of question, like what is the different between coins working in blockchain.



Bitcoin was originally written in C++, looks like satoshi was programing under a windows environment and not linux which was surprising to find out to me.

So for starters, you would need a very high level of C++ to even pretend to start looking at the code.

Once you have adquired an high level of C++, you will need an high level of cryptography to understand the context of what everything is doing and why.

Once you are good in both C++ and cryptography you will be able to look at the code yourself. No amount of youtube videos briefly explaining the code will help if you aren't versed in the programing language used for Bitcoin and cryptography.
Thanks for this information, from where i can understand cryptography ?
sr. member
Activity: 672
Merit: 271
January 29, 2018, 02:14:03 PM
#4
Ofcourse the whole project of bitcoin and its blockchain is conceptualized on C++ Language. It was the most popular programming language in 2005-10. But what most of people don't know is that there is one of the implementation done in Java named as bitcoinj which is primarily for the thin bitcoin clients like the Multibit wallet etc. Moreover as huge black said that there are python implementations too. So the resource libraries today are available in almost all languages but the roots deep down lay in C++ itself. Difference between different coins working in blockchain is the difference of source code itself. You can get more info about bitcoin's original language at https://bitcoin.org/en/development itself.
legendary
Activity: 2646
Merit: 3902
January 29, 2018, 01:41:35 PM
#3
Bitcoin is blockchain protocol (C++ and python implementations). "You must have a background about C++".
I learned from:https://bitcoin.stackexchange.com

python implementations ----> https://bitcointalksearch.org/topic/ann-pynode-simple-bitcoin-p2p-node-94645.
Mastering Bitcoin [Reading]------> http://chimera.labs.oreilly.com/books/1234000001802/index.html
Youtube ------> https://www.youtube.com/watch?v=fOMVZXLjKYo
Online ------> https://bitcoin.stackexchange.com
you can ask here or reddit.com





Hugeblack
legendary
Activity: 1372
Merit: 1252
January 29, 2018, 01:22:59 PM
#2
As i am new of this market and i have some knowledge of programing, i wish if i can understand :
The source code of bitcoin, where i can start, if there video or explain the code is better.
I have a lot of question, like what is the different between coins working in blockchain.



Bitcoin was originally written in C++, looks like satoshi was programing under a windows environment and not linux which was surprising to find out to me.

So for starters, you would need a very high level of C++ to even pretend to start looking at the code.

Once you have adquired an high level of C++, you will need an high level of cryptography to understand the context of what everything is doing and why.

Once you are good in both C++ and cryptography you will be able to look at the code yourself. No amount of youtube videos briefly explaining the code will help if you aren't versed in the programing language used for Bitcoin and cryptography.
newbie
Activity: 35
Merit: 0
January 29, 2018, 09:21:40 AM
#1
As i am new of this market and i have some knowledge of programing, i wish if i can understand :
The source code of bitcoin, where i can start, if there video or explain the code is better.
I have a lot of question, like what is the different between coins working in blockchain.

Jump to: