why was Bitcoin written in C++?
I have tried to figure out why Satoshi decided to go with C++ in writing bitcoin codes. I have some of these assumptions below, I decided to share to learn more;
- Could it be that C++ is the most popular language then?
- Could it be that it is the language Satoshi was more conversant with. As a developer, I try to use the language I know too well, even if it might be inefficient
- Is there any security advantages of using C++? I mean python also supports open source and Js enhances scalability. Why the special interest in C++
- Right now C++ is largely regarded as the best language for crypto coding. Is this accolade given C++ because Satoshi used it and developed the king of cryptocurrency. Assuming Satoshi used another language, is there any possibility that the language would be more adopted for crypto coding
- Finally, is there any possibility that since 1985 C++ is developed, there will be a time it will become an obsolete language and bitcoin codes will require that it should be re-written in another language?
I have tried to figure out why Satoshi decided to go with C++ in writing bitcoin codes. I have some of these assumptions below, I decided to share to learn more;
You have to distinguish between Bitcoin, which is a protocol, and the software that runs full nodes, which is Bitcoin Core in our case.
Your question is What made satoshi written Bitcoin core using C++ as the main programming language.
One of the most important advantages of C++ language is that it gives great control over memory usage, the program can be written will be very consistently without the need to rewrite the code from scratch in case you want to write for a different programming language.
You will find more reasons on the internet, but Satoshi had to choose a programming language and this language was C++ because it is the best and he (she or they) may have other reasons, God only knows.
You will find more reasons on the internet, but Satoshi had to choose a programming language and this language was C++ because it is the best and he (she or they) may have other reasons, God only knows.
It is also believed that satoshi was already of a high age when he created bitcoin, maybe he was already retired or close to his retirement. For this reason he probably was not so fluent in more modern coding languages and also bitcoin works perfectly in C++, so why bother to write it in another langue. You have to remember that at first bitcoin was slimly a project that was managed of a handful of people and nobody would have thought that the adoption would be this huge.
What speaks for this thesis is also that satoshi left bitcoin not long after it was published, since he probably simply retired. That is something a young person would probably not do, but who knows. Satoshi could still be here under another name and nobody would know.
It is also believed that satoshi was already of a high age when he created bitcoin, maybe he was already retired or close to his retirement. For this reason he probably was not so fluent in more modern coding languages and also bitcoin works perfectly in C++, so why bother to write it in another langue. You have to remember that at first bitcoin was slimly a project that was managed of a handful of people and nobody would have thought that the adoption would be this huge.
All the ideas related to Bitcoin were already present, and even the idea of Bitcoin has a historical basis before 2008, but Satoshi was the only one who developed it for a valuable model, and Satoshi was not an exceptionally experienced software developer, and this is evidenced by the presence of a lot of bugs in the versions that he developed .
Age is not a measure. For example, a 15-year-old teenager was able to hack a *wallet* claiming to be an unhackable crypto wallet.
https://techcrunch.com/2018/08/14/unhackable-bitfi-crypto-wallet-has-been-hacked/
Source researchgate/Elise Alfieri (https://www.researchgate.net/figure/Chronological-timeline-This-figure-illustrates-the-chronological-timeline-of-the_fig1_349310768)
All the ideas related to Bitcoin were already present, and even the idea of Bitcoin has a historical basis before 2008
Sorry, but in the interest of slowing the spread of misinformation this is just plainly false. The idea of using a distributed anonymous cryptographic lottery to form a consensus is the revolutinary idea in Bitcoin and it had no historical precedent. People were working on the problem since at least 2001 (https://lists.ibiblio.org/pipermail/bluesky/2001-March.txt) (search spent-twice) and not finding the answer— even though they were well aware of the predecessor technologies: The linked discussion included Hal Finney (eventual creator of RPOW), Adam Back (inventor of hashcash), and Peter Todd (eventual Bitcoin developer).
and Satoshi was not an exceptionally experienced software developer, and this is evidenced by the presence of a lot of bugs in the versions that he developed .
Sorry but that is also a fairly clear falsehood, one spread by inept and inexperienced developers to make themselves sound smarter. Bitcoin was written in a modern style, almost entirely free of manual memory management. Normally in industrial software you expect a defect rate of worse than 1 bug per thousand lines of code and bitcoin had a much higher proportion of tricky parts so I would expect a higher defect rate than typical. Yet the original bitcoin software had an extremely low defect rate— a few bugs in script mostly. More than a few of the ‘early’ bugs found in 2011-2013 were introduced *later* after the initial release, the qualify of Bitcoin fell when public development began but then improved. The defect rate in the original Bitcoin was significantly better than later developed altcoins which had the benefit of Bitcoin as an example and in some cases extremely experienced developers. Comments by reviewers back in 2011 were mostly along the lines of “issues you expect to be there just aren’t there”. The low defect rate is particularly surprising for a one-person project and has even been a reason some people have wondered if Satoshi didn’t have more help than he made publicly known.
Some of these comments are because the original software lacked the modularity that would make sense for the later feature set, but those later features weren’t imagined at the start so designing for them would have been an error and would have increased the defect rate. It’s easy to be critical in hindsight *after* you know the features that would later be developed. But given the amount of *churn* in Bitcoin core, if choice of the correct abstractions and modules is a metric to judge experience we could say it supports an argument that Satoshi was more experience than the entire Core project is today (lol, but I don’t think choice of abstractions is a very good metric).
It’s possible that Satoshi was inexperienced but was a natural at it and worked very hard to get it right, but we absolutely can’t say that there was poor software quality which implied inexperience. I can’t think of a single concrete “inexperienced developers do this” error that anyone has cited (other than the lament that it was not very modular). Even the script bugs, they mostly arose through bad and surprising abstractions in library code— not because of erroneous code that Satoshi wrote, maybe you could argue that failure to anticipate the library code being junk was a mark of inexperience but by that standard almost no one ever becomes experienced.
HQuote from: hZti on May 31, 2023, 9:06:04 AM UTCFor this reason he probably was not so fluent in more modern coding languages and also bitcoin works perfectly in C++, so why bother to write it in another langue.
What more modern language would he have used? The likely candidates that existed at the time have extremely poor performance (particularly memory usage overheads but also runtime), given that Bitcoin has many times been at the breaking point keeping up with the traffic and there are no alternative implementations with acceptable performance written in those more modern languages even today, I think that would have been unwise indeed.
Related entries
