Sunday, June 15, 2014

How does World Cup Spray work?


World Cup ball
Hassan Ammar/Associated Press

In this World Cup, I was surprised when I saw a referee draw a white line on the ground for a free kick. "What a great idea!" I thought. But how does it work? Numerous google searches turned up meaningless articles such as this that basically describe the working principle of the spray as "you spray it on the ground and it leaves a line." NO SHIT SHERLOCK...
So how does it really work? Well, the can is under pressure, probably somewhere around 5 atmospheres of pressure, depending on the strength of the can. The main ingredient is water (80%). A mixture of gases are used to propel the surfactant out of the can, including butane, isobutane, and propane. Once the high pressure mixture of ingredients leave the can and enters the atmosphere, they expand and create a foam on the grass.

The most important ingredient is "polyoxyethylenated sorbitan monolaurate" (aka Tween20 at a concentration of around 1%). This molecule is known as a surfactant (more about this later!) The chemical structure is shown here (from Wikipedia):



Looking at this molecule, the left side is hydrophillic (likes water) and the right side is hydrophobic (likes sticking to hydrocarbon molecules such as butane, isobutane, and propane!) This is the key concept of how a surfactant works: it will stick to the interface between the water and the butane, to form surfaces. This allows the butane to form small drops in water (an emulsion) instead of just phase-separating with all the butane in one half of the can and the water in the other half of the can.

The other key concept is the phase change that Butane undergoes. The hydrocarbons that are under pressure (I would guess 5 atmospheres of pressure) in the can, expand to many times their volume when the enter the atmosphere. This is because Butane is a liquid at room temperature, for pressures greater than 2.5 atmospheres (density of 599 kg/m^3), but it is a gas at pressures below 2.5 atmospheres (density of 2.48 kg/m^3). So the Butane expands to ~250 times its volume when it leaves the can. It turns from a liquid into a gas and expands into massive bubbles. The water in the can doesn't change volume because it's a liquid at both atmospheric and can pressures.

So the expanded butane drops make a foam on the grass, which scatters light and makes it white in appearance. In my drawing, I only showed a few bubbles, but in reality there will be billions of them.

Eventually, the bubbles of propane will combine, pop, and evaporate, leaving only a residue of the surfactant (Tween20) and water on the grass. What makes the bubbles scatter light is the billions of interfaces of differing refractive indexes. Once these interfaces combine to form a thin layer of Tween20, they no longer scatter light, and become invisible.

Now you know: that's how World Cup Spray works!

Some of the other ingredients in the can are: a chelating agent "tetrasodium EDTA acid" at around 2% composition. A chelating agent is basically just a chemical that binds to metal ions. Who cares about metal ions? Well, metal ions (such as those that make up the can) have a tendency to break polymer chains such as the one that is used in the foam. So basically, the chelating agent helps preserve the important Tween20 chains from breaking down during storage in the can.

There are also some preservatives to prevent Bacteria from growing in the spray can if it's left on a shelf for a long time.

I made a schematic diagram of how I understand the can's operating principles. If you have questions, or think that my interpretation is wrong, please let me know and I'll update it! In particular, I'm not sure about the exact state of the foam while it's on the grass surface. Are they bubbles of propane? Or maybe not spherical bubbles?

My interpretation of how the spray works is based mainly on the patent by the inventor that I found here: http://www.google.com/patents/US20120148741

Sunday, February 2, 2014

The thermodynamic limit of bitcoin mining

There has been a trend in improving energy efficiency of Bitcoin mining machines. But how good can they get? What are the fundamental limits to the hashrate? What is the ultimate GH/J?

We can use thermodynamics to explore this possibility. If we treat the computation of a SHA256 hash as a simple operation, with a single bit of entropy required to calculate, then the energy expended to perform the hash is equal to the Landuaer limit: k*T*ln2. The blackbody temperature of outer space (caused by the cosmic microwave background left over from the big bang) is: 2.7K. So if we built a computer that was operating at 2.8 K and was radiating waste heat into outer space at 2.7K, we could theoretically perform each hash at 1.38E-23 J/K * 2.7K = 3.7E-23 J/operation, or inversely, 2.7*10^13 GH/J, or around 13 orders of magnitude better than the current Bitcoin miners! So plenty of room for improvement.

If we assume a Moore's law type improvement in efficiency of doubling every 18 months, then the time it will take before someone develops a thermodynamically limited ASICminer will be 65 years or so. I expect that DNA-based and other soft-matter computers will be much more energy efficient than current CPUs. I think it's not crazy to believe that a soft-matter computer (ie DNA annealing computer) may improve the energy efficiency of Bitcoin mining by a few orders of magnitude. 

So now if we harnessed the entire power of the sun to perform bitcoin operations, with around 3.8*10^26W of power, in theory we could perform: 3.8*10^26W/ 3.7E-23 J/operation =10^49 operations per second. The current Bitcoin mining network performs around 2*10^16 Hash/s, and so there are around 33 orders of magnitude left before the entire power of the sun is consumed calculating Bitcoin hashes.

OK, now what if someone built a hyper-efficient computer? What would happen to the difficulty of mining? Well, currently, the "target" to create a new block while mining on the Bitcoin network is: 0000000000000001F52C00000000000000000000000000000000000000000000
This number means that if a miner stumbles upon a hash that is less than this value, he/she wins the block reward. So around in in every 15 and 1/16 hexadecimals will be rewarded, which is (15 1/16)^17 = 7*10^18 hashes. So we expect each block to be solved in around: 7*10^18 hashes/2*10^16 Hash/s = 350 seconds, or 6 minutes or so. Now if we want to keep the block generation rate of the Bitcoin network the same, but with massively increased hashrate, the target just need to be readjusted. So what would the target have to be if we are using all of the power of the sun in a thermodynamically limited computer that radiates energy into space? Well, the target would have to be 10^33 times more difficult, or 33ln10/(ln16)=27 hexadecimals further to the right. So the target would have to be approximately: 000000000000000000000000000000000000000001F52C00000000000000000

And so, the Bitcoin system is pretty much OK with any foreseeable improvements in computational speed.

If you know how a quantum computer might affect these calculations (I don't), then please comment below!