Connect with us

Bitcoin

Why bitcoin wasn’t written in functional programming hence able to scale?

What makes you think that it is the programming languages that makes Bitcoin unable to scale?

Published

on

The following content was written by Pedagang on September 19, 2017, 01:42:21 AM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


Quote
Objected Oriented Programming is simply not cutting it anymore, specially when it comes to concurrency and parallelism; trying to add concurrency and parallelism to this languages adds lots of complexity and more often than not leads to over engineering and poor performance.

Functional programming in the other hand is already well suited for these challenges, Immutable state, Closures, and High order functions, concepts that lend themselves very well for writing highly concurrent and distributed applications.

But don’t take my word for it, you can find enough proof by looking at the technological feeds of startups like WhatsApp and Discord:

    1) WhatsApp was able to support 900 million users with only 50 engineers in their team by using Erlang.
    2) Discord in similar fashion handles over a million requests per minute using Elixir.


The following content was written by achow101 on September 19, 2017, 02:13:55 AM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


What makes you think that it is the programming languages that makes Bitcoin unable to scale?

The following content was written by A1exander on September 19, 2017, 07:03:02 AM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


Bitcoin scaling problems are not caused by the language choice. Transaction rate is limited by protocol design, not processing power.

The following content was written by coinmachina on September 23, 2017, 08:24:10 AM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


WhatsApp is a centralized service. That is why it can handle 900 million users in real time. It does not need a protocol for fault tolerant distributed consensus.

Bitcoin on the other hand does need such a protocol because it is decentralized in every aspect. This has nothing to do with the programming language used to implement this protocol.

The following content was written by zonezICO on February 15, 2018, 07:10:12 PM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


Hello all,

First time posting here but looking to become a fellow, positive contributing member to this forum.

Sorry to bump this older thread but I did want to continue the discussion over using functional programming for blockchain/crypto projects and add that I think the CONTEXT is very important since as Nikisev mentioned, Bitcoin has scaled but doesn’t C++ have BOTH functional and OO attributes?  

Unless you’re Satoshi Nakamoto, statistically speaking, why would any programmer NOT use functional programming if they had the option due to the potential future bugs stemming from tight coupling and spaghetti code?

@nikisev – You brought up a good point in that if it works and allows fast bug fixing, then what’s the problem?  But that means that the entire system would be DEPENDENT on YOU, right?  While the code can scale, what about the physical operations if you also have to run a business, manage other engineers, etc  

If you have to hand that codebase over to someone else, much less the open source community (which isn’t that the point of ICOs to support the general community?) adds the possibility that someone else might have more challenges in maintaining that codebase than you since they won’t know all the intricacies and nuances that YOU, the initial architect, had.  Versus had they used a functional programming language from the beginning, there would be NO risk of that at all.

Here’s a good video by Uncle Bob of Cleancoders, who uses humor to make his point, that really changed my perspective of using languages/preemptive organizational practices to prevent decreased productivity and lost of morale for the engineers due to “spaghetti code”.  

I recommend the whole video for actual business analytics but if you only have 2 min, 29:08 to 31:00 gives a simple description of the potential problems a company can face that non-technical people would never, ever know.  

https://cleancoders.com/episode/clean-code-episode-1/show

As for TDD, there was actually good Youtube discussion between the designer of Rails, DHH, who thought TDD was crap, Martin Fowler, and the actual inventor of TDD, Kent Beck.  It’s a 6 part series so I’ll just paste the link to the first episode:

https://www.youtube.com/watch?v=z9quxZsLcfo&t=2s

DHH made very good points that TDD isn’t for everybody and actually decreased HIS productivity.  But to my novice thinking, what he failed to convince me of is that his style of working would work for an entire team since not everybody can be a genius like him and Nikisev.  If you have to rely on junior programmers on some level, wouldn’t it make sense to have a very EASY way to find bugs and ideally prevent bugs from even happening?

I think that’s what Elixir (based on Erlang) is good for since it tells you the exact error a lot of the time and Clojure (which still offering OO programming to attract Java guys) has the best practice of relying on the REPL.  I’ve never worked with F#/Haskell or Ocaml but seems to me like they’d all be better choices than a language such as Javascript

Anyways, looking forward to your thoughts as I’d like to start developing blockchain apps but C++ or Go don’t inspire me as much as Elixir or Clojure.  And definitely NOT JS and hope that WebAssembly will someday free web apps from so dependent on it.

Z

The following content was written by Anti-Cen on February 15, 2018, 11:01:28 PM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


Bitcoin on the other hand does need such a protocol because it is decentralized in every aspect.protocol.
No it is not and the miners would soon be up a gum tree without pool sites and you seem to forget Lightning is very centralized and
builds single points of failure into the system.

every man  for himself does not really cut it on large scale systems and specialized coordinator type nodes are needed but that
does not mean we have to lose control and this also cuts down on useless internet chatter.


The following content was written by zonezICO on February 17, 2018, 04:28:20 AM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


Was just working on project in Clojure. JVM man.And all this brackets …cmon.
Erlang is awesome , no doubt , networking performance is just mind blowing.
TDD very useful, i do everything in TDD now. But to a point. If you have to spend 2 weeks writing e2e tests. Well.TDD wont help you.
It allows to pass code to other developers.
Anyhow, i think C++ choice was due to number cranching required for encryption. Cant bit C++ in raw calculation performance in general case on random os with random hardware.



Very cool! So the Clojure project was a blockchain project or something unrelated?  Yes, the brackets/parens are a lot but have you watched any of the designer of the language, Rich Hickey, videos on youtube?  His view of the world and how the mind thinks are really inspiring.  Here are two that I really enjoyed:

Hammock Driven Development (warning, he covers meditation in it)
https://www.youtube.com/watch?v=f84n5oFoZBc

Here is an interview between him and Brian Beckman.  I wish all discussions around programming could be done in this manner:
https://www.youtube.com/watch?v=wASCH_gPnDw

As for TDD, good to hear you practice it (also with blockchain projects?) but agree with you that there’s a certain point that it becomes too much.  I think that was DHH’s point in those videos and of course the infamous Ruby Conf where he fired the initial shots at TDD:
https://www.youtube.com/watch?v=wASCH_gPnDw

(warning: Tons of F-bombs in DHH vid)

I think the best programming language for an open source project especially at the scale of BitCoin is how strong the community is in that programming language. You don’t want to scare people off by making some wierd language choices.

There are situations when a functional language might be better, but the opportunity costs associated with them for bitcoin was simply magnitudes higher.

You make a great point but as I was reading your post, I remembered an article that Paul Graham from Y Combinator said regarding using a Lisp language when everybody was making Java WAS A COMPETITIVE ADVANTAGE.  I’ll paste the link below and some of the text:

http://www.paulgraham.com/avg.html

“Software is a very competitive business, prone to natural monopolies. A company that gets software written faster and better will, all other things being equal, put its competitors out of business. And when you’re starting a startup, you feel this very keenly. Startups tend to be an all or nothing proposition. You either get rich, or you get nothing. In a startup, if you bet on the wrong technology, your competitors will crush you.

Robert and I both knew Lisp well, and we couldn’t see any reason not to trust our instincts and go with Lisp. We knew that everyone else was writing their software in C++ or Perl. But we also knew that that didn’t mean anything. If you chose technology that way, you’d be running Windows. When you choose technology, you have to ignore what other people are doing, and consider only what will work the best.

This is especially true in a startup. In a big company, you can do what all the other big companies are doing. But a startup can’t do what all the other startups do. I don’t think a lot of people realize this, even in startups.

The average big company grows at about ten percent a year. So if you’re running a big company and you do everything the way the average big company does it, you can expect to do as well as the average big company– that is, to grow about ten percent a year.

The same thing will happen if you’re running a startup, of course. If you do everything the way the average startup does it, you should expect average performance. The problem here is, average performance means that you’ll go out of business. The survival rate for startups is way less than fifty percent. So if you’re running a startup, you had better be doing something odd. If not, you’re in trouble.

Back in 1995, we knew something that I don’t think our competitors understood, and few understand even now: when you’re writing software that only has to run on your own servers, you can use any language you want. When you’re writing desktop software, there’s a strong bias toward writing applications in the same language as the operating system. Ten years ago, writing applications meant writing applications in C. But with Web-based software, especially when you have the source code of both the language and the operating system, you can use whatever language you want.

This new freedom is a double-edged sword, however. Now that you can use any language, you have to think about which one to use. Companies that try to pretend nothing has changed risk finding that their competitors do not.

If you can use any language, which do you use? We chose Lisp. For one thing, it was obvious that rapid development would be important in this market. We were all starting from scratch, so a company that could get new features done before its competitors would have a big advantage. We knew Lisp was a really good language for writing software quickly, and server-based applications magnify the effect of rapid development, because you can release software the minute it’s done.

If other companies didn’t want to use Lisp, so much the better. It might give us a technological edge, and we needed all the help we could get. When we started Viaweb, we had no experience in business. We didn’t know anything about marketing, or hiring people, or raising money, or getting customers. Neither of us had ever even had what you would call a real job. The only thing we were good at was writing software. We hoped that would save us. Any advantage we could get in the software department, we would take.”






The following content was written by Kakmakr on February 17, 2018, 07:00:09 AM in the thread Why bitcoin wasn’t written in functional programming hence able to scale?. All content is owned by the author of the bitcointalk.org post. (original)


Satoshi wrote the protocol in the functional language he/she knew. Why should Satoshi have to switch to something new, if he/she could use the tools he/she knew already. You do the best work in the language with the most experience.

There was a similar thread like this, where they critisized Satoshi for targetting the Windows OS for this and most people agreed that it was the most widely used OS at the time.

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Legal

Korbit charged for excessive customer data collection

Korbit, a well-known cryptocurrency exchange, has been charged and fined over “collecting excessive personal data” from at least one of its customers.

Published

on

Korbit, a well-known South Korean Cryptocurrency exchange, has been charged and fined over “collecting excessive personal data” from at least one of its customers. 

Korbit is a South Korean company that is heavily vested in the cryptocurrency market. The brand is owned and operated by Korbit Inc, a company located in Gangnam-gu, Seoul, South Korea. The brand commenced operations in 2014 after securing huge financing from several venture capitalists.

Korbit performs the following cryptocurrency-related services:

  • Cryptocurrency trading for the local South Korean market.
  • Fiat to cryptocurrency exchange services using the South Korean Won (KRW) as the fiat currency of choice.

South Korea has a large cryptocurrency trading market, largely populated by local players and companies who moved there when the Chinese ban on cryptocurrency trading came into effect. By providing the local and regional market the opportunity to use the local currency to purchase cryptocurrency tokens or secure cryptocurrencies for trading purposes, Korbit fulfills a large need.

So Korbit is a very well-known exchange, and they get fined for a matter like that has been a matter of talk between crypto experts.

A Small But Significant Fine

According to Yonhap, a news agency, “ They have been charged USD 4000 for this by a government watchdog for ordering a customer who had attempted to activate a dormant account on its platform to upload a photograph of their national ID card.”

The court took the case before the Personal Information Protection Committee. Then they met in a plenary session to rule on the case. The crypto exchange Korbit argued that it needed proof of a photo ID to prevent financial crimes such as voice phishing scams, adding that account users could begin trading immediately after activating dormant accounts.

But the committee overruled their argument and decided in favor of the user in question, claiming that none of Korbit’s other “big four” crypto exchange rivals (Upbit, Bithumb, and Coinone) required photo ID submission activate such accounts.

The committee ruled that mobile phone verification would have been sufficient in this instance. The exchange was guilty of violating the “principles of minimum personal information collection” specified in the Personal Information Protection Act, which was passed last year.

The decision made was absolutely correct because there was no point for them to ask for full ID verification. Mobile verification was acceptable, and the demand for photo ID verification was completely useless.

Korbit Jumps Into NFT Craze

In the meantime, Korbit has also started selling these days popular non-fungible tokens (NFTs) for a hit South Korea drama series. Per EDaily, Korbit struck a partnership deal with the production company Studio Dragon, the creator of the drama Vincenzo, a mafia-themed series starring Song Joong-ki that aired on the cable network tvN earlier this year.

The deal will see the company sell 100 limited edition official pieces of art based on the show on a first-come-first-served basis on July 21.

Korbit stated that it plans to create more NFT items for “other popular dramas” produced by Studio Dragon.

The company also said and showcased one of the items it plans to sell – an NFT featuring an iconic lighter used by the main and titular character in the drama, also distributed by the streaming giant Netflix.

Continue Reading

Bitcoin

Bitcoin Core 22.0 To Add Hardware Wallet Support

Bitcoin Core will start to support connection with Hardware Wallets with HWI library. New options for hardware wallets will be added to the settings.

Published

on

The latest version of Bitcoin Core v22.0 will add support for hardware wallets. It will start to support connection with Hardware Wallets with HWI Python library. The overall interface of the wallet will change in the latest version and new options for hardware wallets will be added to the settings and then we will be able to create a new wallet with our connected devices.

It is pretty good news and bitcoin users are looking forward to giving this wallet a go as soon as it releases.

Bitcoin Core can be launched with -signer=<cmd> where <cmd> is an external tool that can sign transactions and perform other functions. For example, it can be used to communicate with a hardware wallet.

Among other changes, Bech32m (witness v1) addresses are now supported for most RPC calls. Adjustments were made to the RPC calls for banning, network, and peer information. It no longer supports MacOS versions older than 10.14 “Mojave”.

22.0 Release Notes Draft

Below is a copy of the relevant section of the release notes that mentions the signing feature.


GUI Changes

External signers such as hardware wallets can now be used. These require an external tool such as HWI to be installed and configured under Options -> Wallet. When creating a new wallet a new option “External signer” will appear in the dialog. If the device is detected, its name is suggested as the wallet name. The watch-only keys are then automatically imported. Receive addresses can be verified on the device. The send dialog will automatically use the connected device. This feature is experimental and the UI may freeze for a few seconds when performing these actions.

Example of Usage

Although this tool is hosted under the Bitcoin Core GitHub organization and maintained by Bitcoin Core developers, it should be used with caution. It is considered experimental and has far less review than Bitcoin Core itself. Be particularly careful when running tools such as these on a computer with private keys on it.

When using a hardware wallet, consult the manufacturer’s website for (alternative) software they recommend. As long as their software conforms to the standard below, it should be able to work with Bitcoin Core.


What does the HWI library do?

The primary use of HWI is to discover hardware wallets that are connected via USB ports. It uses the udev project, which means that Windows is not supported. It only works for macOS and Linux. Fortunately, HWI and hardware wallet support are optional in Bitcoin Core. It will continue to function normally if HWI is not installed.

HWI is a command-line program that reads commands from the terminal and sends them to the device. The device behaves as if a human is entering physical input to it and executes the commands the same way it would be done manually. It also has a Python API, which makes it easier to add an HTTP API in the future if desired by the project maintainers.

Supported Devices

The following hardware wallets are compatible with most commands of HWI:

  • Ledger Nano X
  • Ledger Nano S
  • Trezor Model T
  • Trezor One
  • BitBox01
  • BitBox02
  • KeepKey
  • Coldcard

HWI has a support policy that states that hardware wallets must use as much open-source firmware as possible. Closed-source parts are acceptable if they are required by a non-disclosure agreement (NDA). Closed-source firmware is tolerated if the vendor provides active support for it, but the hardware wallet support will be dropped if the vendor stops maintaining HWI support for their hardware wallet. Also, if the hardware wallet stops receiving security updates, HWI support for it will be dropped if security vulnerabilities are found.

Continue Reading

Mining

Meet The Large Companies Investing In Antminers

Why are these companies only buying large quantities of Bitmain Antminer hardware, and how do they receive them?

Published

on

Along with Gryphon and Hut 8 Mining Corp, many other companies invest in bitcoin miners. There’s a reason why Bitmain Antminers are some of the most popular in the world. All of these invest in Bitmain mining hardware only. Gryphon is a minor mining operation compared to some of the more prominent players, but they all have a role to play. We will discuss TeraWulf first.

TeraWulf

TeraWulf is a new mining company based in the United States purchasing 30,000 miners from Bitmain with plans to have greater than 3 Exahashes (EH/s) of Bitcoin Mining power, which is some serious power that would put it in the top 10 mining pools in terms of hash rate. 

TeraWulf is soon to have a Nasdaq Listing; it agreed to merge with Ikonics, an imaging tech company whose stock is traded on Nasdaq. The newly merged company will trade under “WULF”.

TeraWulf is an example of a medium-sized operation, who has also placed its trust in Bitmain to provide mining hardware.

TeraWulf has a long-term goal to mine Bitcoin with more than 90% Zero-Carbon energy. It has around 50 megawatts of electricity capacity, with long-term plans to increase this to 800 Megawatts by 2025. This would enable a hashrate of more than 23 EH/s. It is ambitious, as it would be in the top 5 of hashrate.

TeraWulf’s low-carbon commitment is a sign of the times with concerns about the carbon footprint of the Bitcoin blockchain. Players the size of TeraWulf can make a difference in the carbon footprint of Bitcoin and help set trends.

Core Scientific

Core Scientific is a mining company in North America. It has recently completed a buy of 112,800 ASIC mining rigs from Bitmain. Core Scientific provides hosting services for miners alongside its operations bought S19 Pro, S19j, and S19j Pro miners intending to double its fleet of miners. Core Scientific can also repair Bitmain mining machines that are under warranty, thus offering Bitmain Warranty services in North America.

Core Scientific intends to use half of the machines it has ordered for its mining operations. They will use the other half to fulfill contracts with existing mining clients.

The large 112,800 shipment and future ones of similar magnitude will help Core Scientific more than double its share of Bitcoin’s hashrate. Core scientific currently has approximately 5% of the current Bitcoin Hashrate. They intend to increase this to 12$, according to their CEO Kevin Turner.

Turner’s forecast aligns with the growing presence of North America in the Bitcoin mining sphere. 

Along with Core scientific, Gryphon, and TeraWulf, other mining companies are looking to expand their operations, such as Marathon, Riot, and Blockcap.

Kevin does not expect the trend of big players investing in the mining space to stop soon, and new prominent players are continuing to enter the game. 

Kevin stated that larger numbers of publicly traded companies, large family companies, and hedge funds are looking for trustworthy mining operations in North America. Kevin believes that the United States is interested in being a leader in digital assets, despite other countries being early adopters before the United States was.

Marathon Patient Group

Marathon is another significant player in the Bitcoin mining industry, based in Las Vegas. They mined no fewer than 196 Bitcoins in 2021, worth over $11 million at current prices. Marathon has planned to expand its mining operation to have no fewer than 100,000 miners online by 2022. Marathon’s hold more than 5,000 Bitcoin. Marathon received an order in Q1 of 2021 for 1,300 Bitmain S19 Pro mining rigs.

Marathon will have ongoing shipments from Bitmain throughout 2021, with a plan to have over 100,000 online by January 2022. Marathon’s total network hashrate is estimated at 10.3 Exahashes per second by then, putting them in the top 10. The company used stock offerings and other financings to invest in the latest Bitmain hardware.

Marathon has planned its high-speed expansion to keep up with other big names in the mining industry. The new machines coming online in 2021 after heavy demand has caused the Bitcoin difficulty to skyrocket due to the flood of hashrate. Bitcoin difficulty is the algorithm that keeps the supply of bitcoins and the Blockchain’s growth constant despite the varying market conditions.

The CEO of Compass Mining, Whit Gibbs, commented on Marathon’s “mammoth” ASIC order. He mentioned he feels that this trend of increasing hashrate and difficulty shows no signs of slowing in 2021 and that it should track with Bitcoin’s price.

Continue Reading

Trending