Showing posts with label 21. Show all posts
Showing posts with label 21. Show all posts

Monday, March 7, 2016

Big blocks, small blocks, side-blocks, off-blocks...

In the recent week Bitcoin has experienced another "stress test" in form of a lot of transaction spam (see below for a chart of the amount of transactions in mempool), although this time the spam was not scheduled and it's not clear who was responsible for it. Along with the continuous debate on whether or not to increase the Bitcoin block size, a lot of people have started looking at what are the potential outcomes of the situation. I have covered a similar topic over a year ago, but it might be a good opportunity to revisit the topic and bring everyone up to speed.

A mockup of "Bitcoin surge pricing", inspired by Uber.

The problem


As some of you know, the Bitcoin blockchain was initially designed to have a limit of 1MB per block. This was done due to prevent the bloat and abuse of the network. However, if this limit is strictly enforced, the Bitcoin network would only be able to support a small number of transactions, about 7 transactions per second (compared to Visa's 2000 tps). Clearly, this won't be enough for a payment network that is supposed to replace the banks and credit cards. Either we will increase this size in some way, or we will see Bitcoin become a much different network.

The outcomes


Depending on whether the block size is increased or not and by how much would dictate how the Bitcoin network is shaped. Lets look over some possibilities.

Block size remains rigid


In this approach, the 1MB block size is rigid and remains unchanged. When we start hitting this limit, the miners will be able to pick and choose which transactions to include in the block. Rational miners will pick the transactions that pay them the most in fees (proportionally to their size), thus there will be a bidding war to get into the next block.

Due to the increased cost, fewer people will opt to send transactions themselves, either leaving Bitcoin entirely, or by performing some off-chain settlement. Wallet services such as Coinbase could become more like banks - offering their customers settlement with other people on their platform and other platforms that accept off-chain settlement.

In this scenario, Bitcoin becomes a settlement method for large bank-like wallets and large corporations.


Block size limit is abolished


A polar opposite of the previous approach. The block size limit is completely abolished and miners can create arbitrarily big blocks. While anyone can create a transaction for cheap, the network would soon be attacked by malicious entities trying to push the limit. Someone could decide to generate a 1GB block for example and cause the network to grind to a halt while synchronizing.

Quite quickly running a full node becomes a luxury or a business. We see more reliance on Stratum-like supernodes. The functionality of the network is dictated by them.

In this scenario, the Bitcoin network turns into something like the modern Internet - only big players can access it directly and everyone else has to rely on something like Bitcoin-Internet Service Providers.

Middle of the road


The most likely scenario would be somewhere in the middle of the road - raising the block limit, but doing so gradually. Dedicated users could run their own nodes, but most of us would rely on third parties for helping our wallets function.

Alternative solutions


Bitcoin is both an independent currency and a settlement network for that currency. Whether the block size increases or not, there are a lot of ways one could try enhancing the settlement aspect of Bitcoin.

Soft forks


There are some proposals on how to improve the scalability without hard forking the network. Some of them include softforks such as Segregated Witness , or Sidechains (allowing value to be moved in and out of the Bitcoin network without a trusted third party).

Segregated Witness, or "SegWit" is a solution focused on slimming down the transactions by moving the signatures off-blockchain. This can slim them down to about a quarter of the size, essentially allowing the Bitcoin network to process 4MB of transactions in 1MB blocks. The idea appears to have a lot of support, but since it's mostly streamlining what Bitcoin can currently do rather than creating a whole new solution, there isn't much left to explain without going into technical details.All in all, SegWit can buy Bitcoin some breathing room with its current block limit.

Sidechains is an idea focused on on being able to move the value in and out of the Bitcoin network without depositing the coins with a third party. While this doesn't sound like much, sidechains can lead to a lot more than just scaling Bitcoin - they have a potential of recreating networks with the features of Ethereum or Ripple without having to bootstrap those networks with new coins. These sidechains could be used to settle BTC transactions outside of the network while still not having to worry about the counterparty risk.

Payment channels


Payment channels in general or Lightning Network specifically are an interesting approach to allowing a large amount of transactions to take place outside of the Bitcoin network while everything would still be settled on-chain. The idea was discussed as early as 2011, and today we have some companies that even start advertising it on their websites:


21.co advertising their payment channels right above telling everyone how many blocks it might take to confirm various transactions during the recent spam attack

A payment channel is a way for two nodes to pass payments back and forth between one another using unbroadcasted Bitcoin transactions. Each payment adjust the balances between the nodes - shifting the balance back and forth accordingly. Only the final transaction gets published to the whole world, thus potentially saving a lot of space in a block. While the use case for this solution might be limited (who sends another person multiple transactions over a short period of time?), it gets more interesting when you add the network effect to it.

A simulation of 6 networked payment channel nodes

Now, when you introduce a few "supernodes", possibly in form of Bitcoin exchanges and big companies, you start mimicking the Gateway model of Ripple:

An illustration of the Gateway model of Ripple

Instead of settling directly on the network, anyone can potentially save a bit of fees by connecting to one of the supernodes and establishing a payment channel with them. This would allow you to transact with anyone in the network fast and cheap, while still being able to settle your balance on the Bitcoin blockchain as needed. If the payment channels are open for a long period of time, a lot of people could begin to operate solely within the network. This might be especially important for cross-exchange settlement, or for shared ewallets like Coinbase or 21.co.

Alternative networks


Last but by no means least, we have the alternative networks. A lot of them stand to benefit when the Bitcoin network falters.

Simplest ones would be the altcoins - Litecoin and the like. They reason that if Bitcoin blocks are full, people will join other networks and use other coins instead. I'd take that with a grain of salt, after all, Bitcoin is a better currency in terms of price and market cap than its alternatives, but the other networks might have a higher throughput.


A much more compelling alternative would the the Crypto 2.0 networks and permissioned blockchains - Ripple, Open Transactions, Liquid. Those networks can use the above mentioned Gateway model and move the settlement completely off the Bitcoin network. The only transactions that would need to be included in the blockchain would be deposits and withdrawals. While certainly more rigid and centralized than the payment channels, there are ways of preventing the gateways from stealing one's coins (such as Voting Pools). Moreover, such networks could also be used to issue fiat-denominated IOUs, which might be very attractive for some applications.

Conclusions


The Bitcoin block size debate is still going on, while the blockchain limit is being hit more and more often. Either the Bitcoin network will scale to larger blocks, or higher fees. There are many solutions out there focused on providing alternative means of settling with BTC without having to further burden the Bitcoin network. Only time will tell how our current problems will be addressed and which solutions will be used.

Sunday, January 17, 2016

Stanford University and its native advertising of 21.co

About two weeks ago there was a post on /r/Bitcoin advertising a new course on Bitcoin Engineering from Stanford University. It sounded good enough - there is a lot one can develop with Bitcoin and teaching it at a university would be a perfect way for new people to get exposed into Bitcoin. However, reading some of the topics to be covered, such as "Bitcoin Dropbox" or "Bitcoin WordPress", made me think of some company I covered before on this blog. Reading further down, yup, one of the instructors for the course was Balaji Srinivasan, the CEO of 21.co. "Oh boy!" I thought, "I wonder how much of this course will focus on using the 21 Computer rather than pure Bitcoin...". Today I came back to the website and I got my answer...

It's not often that I get to write multiple pieces on this blog that fit together into a neat narrative, but it seems that 21.co will have the privilege (previous entries - 1, 2).

Course content so far


At the moment, it looks like the course is two weeks in and we have 3 out of 12 rows of documents available publicly:


While it is possible the course becomes more generalized in the future, I have my doubts.

Reading the entire course page, we can see the course is about "Bitcoin and Bitcoin-enabled computing", where the students will be "build[ing] Bitcoin-powered versions of several popular Internet services". No mention of "Bitcoin Computer" or "21 Bitcoin Computer", so one would think you would be building something with perhaps Bitcoin Core, or some other open APIs...



"Pick up your 21 Bitcoin Computer up front". Makes me REALLY excited for the possible upcoming MOOC version of the course (signup form available). Thanks Balaji.

Lab 1, instructions on setting up 21 Bitcoin Computer, followed by some okay explanation of what Bitcoin is, basics of how it works, etc. This is then followed by some hands-on exploration of data in Bitcoin on the 21 Computer, explanation of what mining is and "How to rapidly mine bitcoin with a Bitcoin Computer" (after all, "The 21 Bitcoin Computer includes a fast and convenient way to get bitcoin for programming purposes" - who needs TestNet, right?). After that we learn about the all important "21.co balance and your blockchain balance"...

Guys, there is a reason mining is downplayed in most introductions to Bitcoin (including the version 2 of the famous "What is Bitcoin?" video) - it is a specialized industry doing some of the most boring things around Bitcoin. A vast majority of Bitcoin businesses never touch it, nor care about it. Sure, by all means, explain how it works and what it is, but devoting 11+ out of 54 pages to it in the first lab is an overkill. TestNet exists for a reason - you can get some coins to play around for free and its way less complicated.

After that, we get a document on "Remotely login to your Bitcoin Computer" (I think what you meant  to say was "Remotely logging into"). As expected, more 21 Computer. Finally, we get some document to schedule 'Genius Bar' appointments (Apple much?).

Upwards and onwards to week 1. We get out Lab 0, which is the course overview, how to set up 21 Computer (with a special slide on how to "Mount the 21 hard-drive as a volume on your Mac"...). Not much else to see here.

It looks like the first proper presentation for this course is "Bitcoin: An Overview", which does a decent job explaining what is Bitcoin about, a number of things surrounding Bitcoin. It looks like a decent presentation without plugging 21 Computer too much. I guess that might be because a good chunk of it was presented by Belaji back in May last year at Sunnyvale's Bitcoin Job Fair when 21.co was still in semi-secrecy mode...

After that, we get linked to Lab 1 again, and we also see the first Self Test, including such important questions as:
  • "When you ran `21 status` to create your wallet and 21 account, what username did you select? (If you don't remember, you can run the following command at any time: 21 status)"
  • "How many satoshis do you get each time you run 21 mine? (If you don't remember, run the command again.)"
  • "Fill in your Stanford email and run the following command (if you get an error about your balance, run `21 mine` and try again): 21 buy sms +14084383755 'YOUR_EMAIL@stanford.edu'"
    • For which the only thing to check is " I sent the SMS message using the 21 CLI"

We're now at week two. Lab 2 - after a brief introduction to "Bitcoin Computing", we get a few step process of how to mine some bitcoins, buy and sell digital goods for bitcoin, and learn how to work with the bitcoin library (of course, all with the use of the 21 Computer). [Side note - we get have both the uppercase and lowercase "bitcoin" used to refer to the currency ("buy digital goods with bitcoin", "sell digital goods for Bitcoin") - keep it consistent, please.] Afterwards, we get some example of how to use the 21.co's library on how to develop some software-as-a-service.

After Lab 2, we get our Self Test 2, with the important questions of:
  • "Which of these is the main advantage of using off-chain transactions?"
    • After all, this wouldn't be a course on Bitcoin if we didn't focus on transactions happening outside of the Bitcoin network...
  • "What API calls can be outsourced using micropayments?"
    • With the answers being "Any remote API call", "Only calls that have a high per-use cost", "Only calls that depend on complicated technology, like Google Maps", "Only calls that use cloud services" and "Only calls that require registering for an API key before using"
    • None of the answers are particularly correct, and the question itself doesn't make sense - outsourcing API calls in the context of software development would be more focused on putting the API calling logic in some separate library, rather than as an external product...
  • "After you joined the market with "21 join", what was your IP address for the zt0 interface? (Instructions to get this are in the lab 2 document.)"
  • "Were you able to get someone on the Slack channel to buy your endpoint?"

And that would be it when it comes to what is available for public viewing so far.

Course critique


As someone who has written a Master Thesis on Bitcoin almost 4 years ago, I have mixed feelings about the course. My major gripe is that the course looks like some HEAVY native advertising in disguise. The course website makes you believe you would be working with Bitcoin, but in reality, you are working with 21 Computer and their proprietary libraries. This would be like wanting to take a course on the C programming language, but ending up with a course being on developing Windows Phone apps in ASP.NET as presented by Steve Ballmer. Sure, you would learn some similar fundamentals, but one would be a good basis for learning other C-based languages, a staple in the current industry, while the other would make you a Windows Phone app developer - not something many people aspire to really.

Similarly, since the course requires heavy use of the proprietary $400 device, I doubt many students not physically present at the university would be able to participate. If 21 decided to release some "student version" of their software that can be used on any device - it wouldn't be a problem, but I somehow doubt that would be the case...

That being said, as I stated before, the software itself seems to be quite feature-rich and the examples presented with the lecture wouldn't probably be possible to implement in a short time frame without them. Speaking from experience, one week is about enough to implement a web wallet from scratch if you're using Bitcoin Core for the first time - hardly as impressive as digital content delivery.

The strong emphasis put on mining and the use of off-chain transactions is a bit misleading if you want to learn about programming on Bitcoin. It is yet again 21 pushing its narrative of having mining available on every device and all of them being connected to their proprietary mining pool / shared wallet. It isn't representative of how Bitcoin works in its core, although it may be used as a good example perhaps later down the line of some alternative ways of handling bitcoins.

Lastly, when we're considering that two weeks of this 11 week course are focused on small hackathons, where the "Best projects get written up in Bitcoin Magazine" (from Lab 0), one might start to think that this whole lab exists not for the students to learn about Bitcoin, but for 21.co to get exposure, teach a number of students how to be completely reliant on its software for anything Bitcoin-ralated and possibly get some ideas / examples of what can be built with their hardware and software.

Conclusions


The Stanford Bitcoin Engineering course is a series of labs and lectures on how to use the 21 Computer, as presented by the CEO of 21.co. The majority of learning materials so far are reliant on proprietary software and hardware making it useless for anyone without the device. 

All in all, if the instructors of the course were more up-front about what they are trying to teach in this course I probably wouldn't be bothered by this so much, but as it stands, I can see it as nothing more than Stanford doing some native advertising of 21.co. I'm sure any student that essentially paid $1k+ to take the course will be grateful...

Monday, December 7, 2015

Irrational Bitcoin mining

Irrational Bitcoin mining

Last week we discussed the economics of P2Pool mining with low-powered miners. One of the more interesting comments I came across while doing some research for the topic talked about the possibility of companies like 21 Inc creating a scenario where the Bitcoin mining becomes completely unprofitable for anyone that has to pay their electricity bills. Lets examine how this scenario might impact Bitcoin.

Creating irrational miners


In game theory, one generally assumes that every player in the scenario behaves rationally, that is to say - they are motivated by maximizing their own profits. In the Bitcoin mining world, every large-scale miner is rational - they care about their bottom line and profits. If it is profitable to mine, they mine, if not, they either switch to more efficient hardware (CPU->GPU->FPGA->ASIC->better ASICs), don't turn on their miners (minimizing losses), or outright buy bitcoins from the market (if they aim to accumulate bitcoins).

Since the Bitcoin difficulty is self-correcting, eventually the market weeds out the most inefficient miners until mining becomes profitable again. All in all, it's a strange mix between the tragedy of commons and an arms race that makes Bitcoin more and more resilient to attacks (a potential attacker would have to incest more money into the attack than everyone else combined).

However, earning money from mining is only one motivator a potential miner might have. Just like Google indirectly benefits from laying down Google Fiber that gets more people onto the Internet where Google can monetize them with ads, Bitcoin companies might devote some of their resources to mining even at a loss. For example, SatoshiDice might want to have its own mining pool to push through all of its pending transactions that some other pools might consider to be spam. Big exchanges would similarly want to make sure all of their deposits and withdrawals are processed faster than its competitors, etc. Lastly, companies might want to mine just to make sure the Bitcoin network is more decentralized.

And now, with companies like 21 Inc pushing for inclusion of their mining chips into various devices, we might see an emergence of essentially botnets of low-powered miners contributing their hashing power to their creators.

Botnet mining


Botnet mining bitcoins isn't really all that new. We had some mining viruses bundled with torrents, esports server code, or even embedded in websites through WebGL. However, since nowadays mining with anything short of a dedicated ASIC chip is worth less than the coding time required to run it. However, if we start embedding small ASIC chips into devices, things might get more interesting...

It would be possible for hardware manufacturers to include physical bundleware / crapware into their products similar to how phones nowadays come with pre-installed bloatware. Like 21 Inc's investor slides suggest, those mining chips would probably come with pre-defined address they will be always mining a portion of their income to, creating a revenue stream for the chip or phone manufacturers, or perhaps network operators or the like. I would also suspect that for some amount of time most of those chips would be locked in to a specific pool (similar to carrier-locking), which means most of the value of the chip will probably be extracted in a controlled fashion.

All in all, what would this boil down to? Most likely, the people that purchase the device with a bundled miner that would mine for a specified pool say, when the device is plugged in or charged. Maybe if we're lucky, those devices would mine on something like P2Pool, but that has its own problems. The customers might not notice their devices eat up a few extra dollars of electricity and could break down faster after the warranty is over. They would get some dust balances to use in the Internet of Things, but that wouldn't matter much in comparison to some other implications.

The Bitcoin difficulty could be pushed up over time, accelerating its already fast growth. Traditional for-profit miners would have harder and harder time competing in the market against the botnet. If the miners would really be pushed into every device, they would probably be unable to compete shy of plugging new chips in straight from the factory for mining before consumer electronics devices would go through the process of production-shipping-sale-mining. ASIC manufacturers would probably start offering their own mining chips and compete to build their own botnets of devices with bundled miners. Perhaps there would be some market for second-hand mining chips - the manufacturers would first mine with a fresh batch of chips to get in on the lower initial difficulty (possibly under the pretext of "stress testing"), then when it becomes unprofitable, the chips would be sold to consumers, a bit like what Butterfly Labs was doing, only on a bigger scale.

At that point, we would probably see traditional Bitcoin mining pools be replaced with pools owned by chip / hardware manufacturers or network operators. While the talk of "redecentralizing Bitcoin" is all well and good, when push comes to shove I doubt final consumers would be mining through P2Pool if the profits could instead be directed through some big corporation's pocket. Providing the cost of running such a pool would be small, you could still squeeze in a bit of money out of your consumers by making them pay for the electricity used in mining.

Getting your bitcoins for cheap / free might be undesirable, if you subscribe to the labour theory of value (a good is worth about as much as it costs to produce it). While a mining pool today might be more careful with its hard earned coins - selling them for as much as possible, waiting to sell if the price dips, etc. - a botnet mining pool might not care as much. They might also not care as much about various Bitcoin issues - they might not vote on various BIPs, not care if their software provider creates a pool that censors some transactions, create empty blocks, be easier to sell their mining power to "double-spend-as-a-service" pools, etc. If the mining is forced onto the users, they can't vote with their feet unless they are willing to unplug their electronics completely.

Conclusions


While the current state of largely centralized mining pools might be a potential Sword of Damocles hanging over the Bitcoin network, they have a strong incentive not to attack the network:

If a greedy attacker is able to assemble more CPU power than all the honest nodes, he would have to choose between using it to defraud people by stealing back his payments, or using it to generate new coins. He ought to find it more profitable to play by the rules, such rules that favour him with more new coins than everyone else combined, than to undermine the system and the validity of his own wealth.

Giving the mining power to everyone through a P2Pool-like solution might be seen as similar to low information voters - a lot of them would not know what to do.

If embedded mining chips become more widespread, we could see them disrupting the current mining status-quo, but I ultimately doubt the new mining pools would be much more decentralized than the current ones. They would also have less incentives to care about the Bitcoin network - it's not their main business.

Only time will tell how this will play out.

Tuesday, December 1, 2015

P2Pool and low power miners

Recently, we got a new insight into 21 Inc's plans for its mining computer / chips - allowing the device to connect and mine on any pool, and ultimately - mining on a P2Pool-like network to further "redecentralize Bitcoin". This got me thinking about whether P2Pool would actually be compatible with a potential large swarms of low-power devices mining together. Lets see how it might work.

What is P2Pool?


P2Pool is an interesting idea that came about around 2011 to address the growing centralization of Bitcoin mining in mining pools. Instead of connecting to a centralized pool, a miner would instead join the P2Pool decentralized network and start mining there. The block reward would be split between peers based on how many "shares" they contributed to the decentralized network - essentially creating a decentralized "Pay Per Last N Shares" mining pool.

What is very interesting about P2Pool is that it allows for the decentralization of mining - anyone can join the network and contribute, you are free to mine for any valid block as long as you respect the mining reward distribution and all in all it once again allowed smaller miners to mine for Bitcoin blocks without relying (or giving power to) any centralized third party.

However, P2Pool is not without its disadvantages.

It is reportedly underperforming / being "unlucky", indicating that it might be experiencing a higher rate of orphaned blocks. This could be due to traditional mining pools optimizing their new block discovery time (I heard someone mentioning a dedicated communication network for the mining pools, but I can't find a source for that claim currently), while P2Pool might be reliant on the Bitcoin network itself, which can take a few extra seconds to populate.

P2Pool coinbase transactions are pretty big in comparison to the traditional mining pools' transactions. This means the blocks themselves can process a few fewer transactions, and there is a practical limit to how many outputs one can reasonably fit into a transaction to pay for the last N mining shares.

Mining at a traditional pool uses about 20MB per day, or 600MB per month. In comparison, P2Pool puts a much higher burden on the data transfers at about 38GB per month before we start taking the resources used up by BitcoinQT which you also have to run.

All in all, if you are mining on a computer with a good internet connection, a reasonably powerful set of miners attached and you don't mind earning a few percent less than you otherwise could, then P2Pool is not a bad choice.

However, what if you are dealing with mobile devices equipped with low-power mining chips?

21 Bitcoin Computer with P2Pool


Looking at the limitations of P2Pool and what 21 Inc is aiming to do with their mining computer, there are a few problems that stand out.

Currently, P2Pool pays its miners directly in the block coinbase, while 21 Inc prefers to buffer the balances at its shared wallet before letting you withdraw the mined dust to a wallet. If the 21 Bitcoin Computer was instead to be paid directly with the coinbase, you might quickly run out of block space. Looking at some sample P2Pool coinbases (1, 2), we can see about 200-250 outputs being included on average, taking up about 8kB of space. This roughly puts an upper cap of 32'000 outputs on a transaction before a whole block is filled with only the coinbase. Equally divided, every output would receive about 78125 satoshis, worth about 27 cents (at  current 356 USD/BTC exchange rate). This would represent about two days of mining for one of the 21 Bitcoin Computers.

32k computers mining a block every two days is fairly incompatible with 21 Inc's vision of "buffered pool mining" (quick way of mining coins to use for transaction) and putting a mining chip into every gadget.

Based on the amount of unique entities you want on the Bitcoin network, we can start extrapolating how often they could get paid on average. Sticking with the 32k outputs per block, we would have 4'608'000 daily outputs. If we looked at the sales of only iPhones in Q4 2015 (48.05M), we would require over 10 days worth of blocks to credit each of those devices individually. This is all before those transactions are again spent, before taking into account all the other smartphones, quarters and every other potential device one could think of in the Internet of Things world. All in all, Bitcoin couldn't handle this level of spam even if the blocks were increased.

Looking at the mobile data plans of a company like AT&T, 40GB/month would cost one about $300, or about $10 per day. The data price for P2Pool alone is 37 times more than the 21 Bitcoin Computer would earn. Mining at a pool would cost somewhere between $20-$30 worth of a data plan, making the data only twice more expensive than the bits one would earn before taking electricity costs into consideration.

Optimizing for your needs


All in all, it would appear that with mining, like with project management, you have three variables:

  • Centralization vs decentralization
  • Low vs high variance
  • Whether small devices can efficiently mine or not
But we can only pick two of them. Decentralized low variance mining but not good for small miners? That's P2Pool. Centralized low variance mining for any device? Centralized pools. Decentralized mining for any device but with high variance? Solo mining.


Possible solutions?


While with the current technology it might be rather impossible to achieve what 21 Inc is aiming to achieve in full, there are some ways one could compromise while still achieving some of the desired outcomes.

First of all, one could try creating an intermediate solution between a fully decentralized P2Pool and a completely centralized mining pool. Perhaps we could see a lot of new, smaller mining pools popping up based on carrier, manufacturer, geography, etc. that the devices could connect to and contribute the mining power to instead. This would allow the balances to be stored on shared wallets and used accordingly, perhaps aggregated into bigger payments or some off-chain settlement between those nodes (and oh god, we're coming back to the tired 2013-era block size debate and ways of settling without bloating the blockchain...).

We could focus on creating bigger mining devices that would power our mobile wallets. This device could stay at home and mine coins using the standard P2Pool protocol, rather than having a miner in every device. This would probably just get us back to the buy vs mine debate once more though. We could even do without all the physical mining and purchase some virtual mining contracts instead... Moreover, the situation is no different than what one can currently do with the existing mining hardware and since we don't seem to be doing that en masse suggest we wouldn't do it in the future either.

Lastly, we could just ignore the variance and mining profitability altogether and just starting to waste money for the benefit of the Bitcoin network. While this might sound crazy, it might not be that far-fetched of a plan. Chip manufacturers would probably make more money than the chips could ever mine, so they could just fork over some money to pay the mining rewards in a Pay-Per-Share scheme. Mining would still go to secure the network, perhaps in an inefficient way, and we might just end up with the entire Bitcoin mining ecosystem being generally unprofitable to mine in. Since the cost of mining would be distributed between potentially many millions of people, the individual burden might be small in comparison. However, this entire idea would best be suited to an entirely separate post I might do at some other time.

Conclusions


All in all, P2Pool currently is rather incompatible with low-power miners, especially if data bandwidth and profitability is an issue. If there is some way to solve the the underlying problems with how P2Pool operates to address those issues, I would love to hear more, but I doubt we'll see any concrete informations on the subject any time soon.

Thursday, November 19, 2015

21 Bitcoin Computer - the Macintosh of Bitcoin

It looks like the 21 Bitcoin Computer has began shipping recently for $400 apiece. Moreover, we also got a few extra bits of information from the 21.co website about some features and solutions of the machine and the ecosystem in general. Since guessing the business model of 21 Inc seems to be everyone's favourite activity for about half a year now, lets not waste any more time and dig right in.

The hardware


First of all, we've got some photos of the actual machine. The packaging looks good, the mining component of the device looks sleek and elegant, while the actual computer is a standard Raspberry Pi 2 (according to the FAQ). Strange it doesn't come in a case, especially given that even their setup steps seem to be aware that this might cause some problems:



The 21 Computer's mining chip appears to have the following specs:

  • 0.16 Joules per Gigahash
  • 50 Gigahashes per second
At the moment there don't appear to be any upgrade / swap options for the machine.

This seems to put it in the same category as Antminer U3 Batch 2 - currently selling for $20 and clocking in at 63GH/s. The energy efficiency is rather odd - comparing it to existing solutions, it would be at roughly 6250 MHash/J, while the top performer, AntMiner S7 performs at 4000 MHash/J. This would seem to suggest the chip is underclocked to be more efficient.

This is a little ironic coming from a company that wants to put mining chips into mobile devices - if you're worried about the power efficiency of a device that runs straight from a power adapter, and yet you want to include extra power hungry hardware in devices that run off battery power...

At any rate, this puts the value of the whole package at under $100 (with the Rapsberry Pi 2 along with all the extras selling for about $70 at the moment). But, the hardware isn't everything, so lets look at what else we get with the 21 Computer.

The Software


It looks like the 21Inc's software is quite packed with features. The CLI looks exhaustive, you can run a full Bitcoin node, you have your wallet, etc. We have some reports of people running things like the Open Bazaar project on the device just fine.

All in all, it looks like the software is the meat of the package. I've seen a number of people being interested in the software component more so than the whole package itself. Luckily, it seems that one can get the whole open source software without having to buy the 21 Computer:

> curl https://install.21.co/bitcoin-computer/install.sh | sudo bash

Beyond that, I personally don't have much else to say about the software in general. It looks to be delivering on what it's promising in one neat package.

The Rest


Beyond the hardware and software, it looks like (at least for now during the launch week) 21Inc has some responsive consumer service, which is great to know. If some people get into Bitcoin because of this computer, this can be a very valuable service to make sure they stay interested in the service.

The 21 website has a few interesting tutorials on what could be done with the software. Moreover, with the $200 tutorial bounty, we can expect to see more articles popping up over time.

Beyond that, we come into some more interesting nuggets of what could either be something really insignificant in the future, or perhaps will end up as a starting point for something more insidious...

The Quirky


Wallets

It seemed that from the very beginning, 21Inc was aiming to sell everyone on the idea of combining Bitcoin mining with Internet of Things. However, as I discussed almost half a year ago exactly, this makes no economic sense whatsoever. Mining dust wouldn't even cover for the transaction fees, much less amount to anything useful.

However, in their tutorial on micropayments, we can see that probably the encouraged method of transferring money between individuals won't be the Bitcoin network itself, but the so called "BitTransfers", which looks like a fancy way of saying "shared ewallet transfers". In other words, 21Inc is building itself up to be something like CoinBase for the IoT world - settling peer-to-peer transactions using its centralized database.

Mining

Now, to load the wallet, one would of course mine the coins using the 21 Computer. Even in this area could be spruced up with some marketing talk, as we go into the mining tutorial and "buffered pool mining". 

We start with a time lesson talking about transitioning between CPU mining into pool mining when one couldn't realistically mine a block by themselves. Pooled mining allowed one to reduce the reward variance (without the pool, you either got a whole block and 50BTC, or no block and no reward, while pooled mining allowed you to get a fraction of the reward, but at a more regular pace). 

Afterwards, we seem to get a vision of what 21Inc wants to sell as the vision for its computers - "redecentralizing Bitcoin" by the use of "millions of mining chips worldwide each generate a small stream of bitcoin" as they believe the ASIC chip development will start following the Moore's law in the near future.

However, since the default way (and possibly the only way without modifying the software) to mine on the 21 Computer is to connect to the 21Inc's pool and receive the dust rewards in your 21 shared ewallet, it's not really a decentralization of mining as it is adding another central server to the equation.

Perhaps if we would instead see P2Pool on the device we could call it an effort in the right direction, but then you wouldn't be able to solve the mining variance problem very well, nor would you lock people into your walled garden of an ecosystem.

In the next section we get another new buzzword - "Buffered Pool Mining". You see, 21Inc believes that if you're mining in a pool, you will have to wait:
  • For the pool to mine a block before you get paid
  • To mine enough coins to reach the minimum withdrawal threshold
  • For the block to mature over 100 confirmations before you can get paid
  • To earn bitcoins before you can spend them again if you run out

Instead, 21Inc essentially combines its shared ewallet with the circa 2011 BitPenny's idea of Pay-per-share. As described in the Bitcoin Wiki:

The Pay-per-Share (PPS) approach, first described by BitPenny, is to offer an instant flat payout for each share that is solved. The payout is offered from the pool's existing balance and can therefore be withdrawn immediately, without waiting for a block to be solved or confirmed. The possibility of cheating the miners by the pool operator and by timing attacks is thus completely eliminated. 
This method results in the least possible variance for miners while transferring all risk to the pool operator. The resulting possibility of loss for the server is offset by setting a payout lower than the full expected value.

I wonder how hardened is the 21 mining pool against what an attacker with a state-of-the-art mining rig could throw at it...

But we also get one more interesting feature, which is essentially Bitcoin, lets say, nanolending:

Finally, you do not need to send N hashes to the server before getting N hashes worth of mined bitcoin. That is, by invoking 21 mine your 21 Bitcoin Computer can receive bitcoin in advance of future mining at the expense of a small asymptotic slowdown in the rate of bitcoin streamed to your device.

Which considering the price tag of the machine is still rather amusing.

We conclude the tutorial with:

The basic idea is that buffered pool mining is a new way of getting bitcoin: not by buying huge quantities slowly for investment purposes on an exchange, but by mining tiny quantities rapidly for programming purposes at the command line, rate-limited by a mining chip.

I guess someone forgot the middle-ground of being able to buy a small amount of BTC, for example by phone, getting small amounts of coins for free (through facets or by signing up to various wallets), or if you're really a developer, using TestNet Bitcoins.

Anything else?


As someone that frequents the Bitcoin-related subreddits, I noticed a large amount of submissions about the device recently. That's to be expected when a new, big product launches and everyone gets their hands on it. However, some of the submissions and discussion appears to be somewhat astroturfed. Submissions titled "Whoa" that aren't some Shiba Inu memes generally don't do very well on a crypto subreddit. Cynical quips usually stick better, you rarely see people talking in bold (1, 2), and hardware is rarely inspirationally compared to some major milestones in commercial computing. Even the self-post appear a bit defensive (1, 2). My money would be on at least some of the sentiment being not entirely as grassroots as it might appear in the first place...

Conclusions


Coming back to the title of my post - 21 Bitcoin Computer to me looks like a Macintosh Computer for Bitcoin - an overpriced, underpowered piece of hardware coupled with some decent software. It appears to be building the roots of a walled garden of closed-loop wallets and related ecosystems. If you're a developer, you can do better, both in terms of mining performance, computing speed and price for a throwaway machine for testing. Their software and related articles appear to be the main piece of value added.

For $400, even for a "dev kit" as it's sometimes advertised, I would still rather buy some BTC (by "buying huge quantities slowly for investment purposes on an exchange" - which would still be a smaller investment than the machine) instead of committing to mining. But perhaps it's like some random comment said on Reddit - "the investment will get you to commit to using it".

Related discussions:



Thursday, May 21, 2015

Much ado about nothing - pondering 21Inc

Much ado about nothing - pondering 21Inc

In the last few months a lot of people have been talking about the "mysterious 21 Inc" - a Bitcoin startup that raised $116M in recent funding to work on their secret technology. Everyone was speculating on what it could be based on the little information that we had from their job offers looking for ASIC engineers. People were guessing they could be making space heaters that earn money, or perhaps an ASIC-powered toaster. Well, the wait is over and we finally know that their big plan was... to put Bitcoin miners into phones...

Lets ponder for awhile how feasible this approach could be.

What are the current rates?


As with all analysis related to Bitcoin mining and profitability, everything is in the state of flux. So here are some current numbers we will be using for those of you who might be reading this in the future.


Based on that, we can do some calculations. That chip is currently mining about 0.000037BTC per day, earning about 0.013540 BTC or $3.17 per year if you run it at no cost. If you take the cheapest electricity cost of say, India or China at $0.08 / kWh, your annual profit is about $1.28, so you break even for the cost of a single $1.5 chip after 428.5 days of mining.


The current standard transaction fee in Bitcoin is about 0.1mBTC per 1000 bytes. The chip could make this much in about half a week.

Currently the difficulty on the Bitcoin network has slowed down its growth. It currently is about 48B, 5 months ago at the start of the year it was 40B, it was 23B in September of last year, and 13B in July of last year. So the difficulty has grown by roughly a factor of 4 since last year, but currently it looks like it slowed down to under a factor of 3 annually.

Estimating how much bandwidth a Bitcoin miner takes can be a bit tricky. Some people have reported it using about 20MB per day.

The difficulty approach, versus the simple approach


Looking at all those numbers, it looks like the mining doesn't scale all too well. In order to mine a dollar of bitcoins using a single chip it would take a phone non-stop 4 months of work. During that time, the phone would need to be connected to the Internet, powered up and heating up from the mining. Subtract from that the cost of electricity, mobile data and so on, and you might be operating at a loss in most situations. This is not to mention the decreased battery life from higher heat exposure and so on.

All in all, ASICs operate the best with economics of scale in mind - producing chips in bulk, cramming them into well-ventilated chassis, putting those in a data warehouse and so on. Perhaps instead of cramming a cellphone with an ASIC chip, it could come with some cloud mining subscription for life where a given datacenter would mine for BTC in the device's name and send those coins to the address bound to the phone over the years?

Alternatively, do away with mining and just buy some coins up front. Add $5-$10 to the phone's price up-front, but BTC with that money and trickle the coins into the device say, once a week or whenever the balance is getting low. Heck, if you notice a device's balance is still positive, you can always keep the coins for longer and perhaps even cash the coins after a year of inactivity of a potentially dead phone. This solution is much simpler and elegant. Best of all, since all Bitcoin balance data is public, you can top people's phones up without checking with them - you will know when their balance is running low.

Conclusions


Sometimes the first solutions might be the most obvious, but there are more elegant solution to solving the same problem. Cramming Bitcoin mining into devices in a way that detracts from their primary usage doesn't make sense. If you want a device augmented with Bitcoin mining, make sure its primary function is generating heat - this way even if the toaster or the space heater doesn't earn any money, it will still be a useful source of heat, rather than a hotplate for a phone that just eats your bandwidth.