In a nutshell, this is what I tell people when they ask me if they should buy some bitcoins:
I cannot stress it enough: even if Bitcoin becomes huge, you may still lose everything for many reasons. Be careful.
It’s a great journey ahead of us, but it’s bumpy. Don’t dive in without proper training.
Some people think that gold is easier to hide or bury than Bitcoin. They like that gold was used for 5000 years and you can touch it. They dislike 4-year old internet protocol because they do not understand it.
First of all, money is information. Gold encapsulates information “I own that much of current purchasing power” via its hard-to-duplicate physical properties. The harder it is to duplicate and easier to verify, the more liquid it is. To hide information embodied in gold, you have to hide your brick somewhere in the physical world. Since 1 kg of gold has quite a big market value for a single person, hiding it is not a big problem.
How does Bitcoin look from that perspective? Bitcoin stores information about your purchasing power using decentralized database. Bitcoin is much harder to duplicate or create (you can suddenly find some gold in the ground, but with Bitcoin supply is known in advance). Bitcoin is much easier to validate with 99,9999999999999999999% certainty using cheap commodity hardware anywhere in the world. Gold verification ultimately needs to be melt down and checked by experts, or you have to trust some certificates and less accurate checks.
How would you hide Bitcoin? Even easier than gold. If you print your private keys or passwords on a piece of metal, you can use the same hiding techniques that apply to gold. But you have also purely digital options. You can simply remember the password. Or write it on a small insignificant piece of paper. Or split the secret via Shamir’s Secret Sharing Scheme and send pieces to friends and relatives.
Finally, the killing feature of Bitcoin is that you can split your stash in 100 pieces and send them to 100 different people anywhere in the world in a matter of minutes without any single person knowing about that. If you need to buy something with Bitcoin, you can do it right away. With a brick of gold — not so much.
When Bitcoin kills money printing and slashes a lot of taxes, smarter people will run from the government while the dumber ones will take their positions.
As economy gets more liberated, the parasites will get less and less efficient and more discredited in the eyes of population. More stupid restrictions will become law which will only accelerate resistance, but will never achieve anything useful for tyrants. Politicians and police will be massively bribed to not interfere with private business.
Government will become less and less relevant until it ends with a bunch of starving die-hard socialists and racists lying in an empty post office.
Imagine if you prefix your open source license with bitcoin addresses of major contributors with their designated shares:
Copyright (c) 2013 MyProject Developers
Send donations to these addresses:
1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T 750 Alex Johnson
139FpKh63Vn4Y73ijtyqq8A6XESH8brxqs 200 Mike Brown
1PNvbXZFysxvx3252w9JHMa7zbG95snqnm 50 Jack Howard
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
A bitcoin wallet app may parse each line as 1) bitcoin address, 2) number of shares and 3) a name of the person separated by spaces. Any amount entered by the user will be split in proportion to the number of shares and will be sent in a single transaction.
Initial developers will decide how they split shares among themselves and how they grant them to new contributors. Every user will see how money will be distributed before payment. This removes great amount of “budget management” politics. If developers cannot come to a “fair” distribution of shares, they will not get any donations at all (because they’ll get them only after they decide how to split the earnings).
Usually, every project starts with a single person, who puts his bitcoin address right in the license, so anybody can send him a “thank you” payment. When another contributor joins and initial developer wants to share earnings with her/him they decide on share distribution. When third person joins, both previous shareholders decide who gives up how many shares in favor of a newcomer. Every developer is always free to redistribute his own shares to whoever he wants without asking permission of other shareholders.
When people see that Bitcoin grows 300% in a couple of months, they do not believe there is a real reason for it. It must be a speculative bubble, things normally do not grow that fast.
When you invest in a company, it takes time to produce something. The value cannot simply jump through the roof because there are humans working, everything is hard and no one knows if the final product will be appreciated by the consumers.
Except, in case of Bitcoin this analogy does not apply. First, Bitcoin in a sense, is already a product available for everyone. It is already produced and proved to work, so you do not really invest in something that does not yet exist. Secondly, when investing in Bitcoin you do not invest in some particular business with a group of people managed by a single CEO. You invest in a huge variety of businesses in multiple countries with different business models, different risks and legal environments. So even if one of the businesses makes a big mistake, Bitcoin is still in demand by many others.
Of course, it does not prove that Bitcoin is inherently less risky. Even if the number of global risks is lower than in a private company, one single risk can outweigh all benefits and destroy your investment. But you should understand the fundamental difference between individual stocks and Bitcoin: investing in Bitcoin is like investing in the whole stock market 100% filled with startups and hot new ideas, not some portfolio of relatively stable stocks with the proven business models and moderate revenue streams. Of course, many startups fail. But when some succeed, they succeed spectacularly and cover all the losses. Buying Bitcoin is being a venture capitalist yourself on a worldwide scale.
This is a very nice article about several Bitcoin protocol improvement proposals (BIPs), but it also explains how scripts work.
The last post was filled with different ideas and did not show clearly the single principle behind it. Here I will try to explain it on a simple example.
Imagine you are selling apples. You are selling, like 100 apples per day for $1 each. Suddenly the demand for apples grows. People want to buy more than 100 apples per day. If you haven’t yet increased the supply of apples, people will try to outbid each other. Say, the most prominent apple lovers are willing to pay $1,5 per apple. For you it means an immediate increase in revenue: up to $150 per day instead of $100.
For a minute lets suppose that your apples are special and you have no competition. Will you earn even more if you increase supply of apples? You cannot really know in advance because you never know the “demand curve” (because it does not really exist and demand changes over time). On one hand, your revenue may drop down: more apples mean less competition for them and a lower price. On the other hand, the price may get lower, but the increase of purchases will be greater, so the total revenue would be even bigger. Also, if you reduce supply to 10 apples per day, it does not mean that you will find customers willing to pay $15 or more to make a bigger revenue. Maybe at some point they’ll buy something else or abstain from buying at all.
The important point is that the only way to know the best price and the best amount of supply is to try different amounts and settle at the optimum point. In other words, when demand grows, you should always be able to increase the supply to see if it increases your revenue or not. If it does not, you may lower the supply back to optimal amount.
Back to the block size. Today, miners and customers do not hit the limit of 1 Mb per block. The limit virtually does not exist (blocks are typically under 250 Kb due to optional limit). The limit could be 100 Gb and the blocks would still have the same size we have today. So nobody would take the risk to change the rule because the rule does not affect anyone.
Fast forward a year or two from now: the amount of transactions is growing. If the miners do not find it efficient to send bigger blocks (due to bandwidth latencies causing more orphaned blocks, or storage costs, or time spent on verification or something else), they will not send bigger blocks. So the limit still would not matter. But if they find it efficient to send blocks up to 1 Mb in size, they will “feel” the limit. Block size cannot be arbitrarily increased, so transactions will begin competing for a place in the block. Transaction fees will rise. But we don’t know how much they will rise. At some point, for some people it would be cheaper to use external clearing houses that will offer lower fees and sync with blockchain less frequently. For miners that would mean uncertainty. How much would they earn in fees if the block size can be increased? Will they have bandwidth problems? Will they have bigger or smaller revenue? The only way to know for sure is to try, but you cannot try it unless you increase the limit. So they would naturally be motivated to increase the limit to be allowed to find an optimal block size.
Who else would be motivated to do so? Customers, of course. They would like to pay lower fees for non-mediated transactions instead of relying too much on clearing houses. Even clearing houses would like to have a bigger limit so they pay lower fees. Because clearing house provides additional service of instant confirmation (vs. 10-20 minute confirmation by the blockchain) and there would always be people willing to pay for that service. In addition, clearing houses may provide arbitration and many other extra services. In other words, everyone who creates raw transactions is interested in having lower mining fees.
The only people in disadvantage are nodes that have bandwidth/storage problems. Those who mine on lower bandwidth are having the same economical disadvantage as having slower computer. The fastest miners earn more and that’s what matter for clients. It is absolutely the same as with people who mined on a single GPU and now have to switch to ASIC or drop out. The non-miners would have to compare their costs of delayed validation with the costs of upgrading their network. If they choose slow network and delays, their customer base will be limited: customers who want faster validations will switch to faster competitors. In the end, if the majority of miners and other users sees it economically more profitable to try bigger blocks, they will switch and the minority would have to adjust. But since there is some level of uncertainty here, the limit will never be abolished or raised too much. Most probably, it will be increased by a factor of two, so everyone can easily calculate their costs and risks. And if the 2 Mb block turns out to be too expensive, miners would simply create smaller blocks until we have better networks or faster computers.
And the last point: the hard fork does not imply that everyone should switch some other rules at the same time. Updating software is not that expensive. It is expensive to come to a consensus. And the more stuff you put into a proposal, the harder it will be to get a consensus. However, if people feel need to update two simple lines of code and bump the limit from 1 Mb to 2 Mb, it will be much easier to come to an agreement. And repeat again when necessary.
Summary: no one will change the block size limit until it is reached. And when it is reached, Bitcoin users will switch to a slightly higher limit (e.g. from 1 Mb to 2 MB), so everyone can try and see if it is profitable. If it is not, then miners will simply mine smaller blocks. But if it is profitable, more transactions will go through, until we hit the limit again and repeat. Most probably, the block size limit will never be abolished because of the fear, uncertainty and doubt that people generate in a hard fork discussion.
Bitcoin blockchain has a built-in limit of 1 MB per block of transactions. Bigger blocks are rejected by other nodes as invalid. This means that at 10 minutes per block and with average transaction size of 400 bytes, Bitcoin network registers about 40 transactions per second.
The limit was set in place initially to make sure that the network is not spammed with huge blocks with useless transactions when people were just starting playing with Bitcoin and mining blocks was possible on personal computers. Huge blocks could lead to excessive use of bandwidth which could lead to higher percentage of orphaned blocks due to higher synchronization delays. There was no empirical proof for this limit, it was mostly an intuitive safety mechanism, “good enough” in the short run. Satoshi, the initial developer, suggested that the limit is temporary and should be raised or removed once the network becomes more powerful and could sustain larger amount of transactions.
It is important to keep in mind, that the limit was almost never exercised. So even if there was no hard limit, the blockchain would not grow faster. It was just a precaution. (Assuming, the soft limit of 250 Kb which is not enforced, would still be there.)
Today the number of transactions is steadily growing and may hit the block limit within a year or two. So people start discussing whether the block size limit should be raised, eliminated or if there should be scheme to adjust it dynamically. To change the limit, a consensus will be required. More than 50% of nodes running the full chain must agree to a new rule to switch to it.
What are the factors at play?
Some people fear that if block size will become unlimited, miners will include a lot of spammy transactions, eat everybody’s bandwidth, fees will get lower (thus undermining sustainability of the blockchain in the future) and some miners with poorer connection will be forced out of the market which is supposedly unfair to them.
In reality though, Bitcoin as any other free market, has nothing to do with fairness, but everything to do with mutual satisfaction of self-interests. Miners are motivated by increasing their revenue short term as long as ensuring their investment and raising value of BTC in the long term.
Is there any natural limit on the block size? Sure there is: it is network bandwidth and the costs of storage and transaction verification. The more transactions you need to verify and transmit, the higher your operating costs and (most importantly) the higher the risk of orphaning a block. If the block is too big to be distributed and verified by other peers, the risk of somebody else creating a shorter block in parallel gets higher. If the shorter block gets validated by majority faster than the longer one, the latter will become orphaned. Orphaned blocks mean immediate loss of time and money for miner, and since transactions are rescheduled and delayed, frequently orphaned blocks undermine market value of miner’s savings.
Miners already can choose any block size within the limit and many use the default soft limit of 250 Kb. If it was profitable for some of them to create bigger blocks, they would do that already. Since they do not, it shows that there are market forces at play and hard limit does not matter yet. Even if it was 100 Mb, the blocks would still be compact.
As the base reward is still comparatively big (25 BTC till 2017), miners are even more likely to keep the blocks as small as it does not hurt the market price. Transaction fees contribute 1.12% of the revenue, while bigger blocks with more transactions increase risk of losing 25 BTC. As time goes by, more transactions would compete with 25 BTC reward, increasing average transaction fees. Increasing fees will motivate miners to allow slightly larger blocks (until the risk of losing reward is balanced by the amount of fees). Halving days would only increase motivation to include more transactions. And as blocks and fees get larger, miners would take care of ensuring better connectivity to keep risk of losing blocks low.
It is true that the miner cares about propagating the block as fast as possible to reach the 50%+ of other miners. Some people think the bigger block sizes will favor miners with better connectivity and poor miners somewhere in Botswana will be out of luck. This is shortsighted speculation. A miner with slower connection can always create smaller blocks than other miners to compensate for the connection problems. If it is not profitable for him, it’s not a problem of other users. If I want to mine from a middle of Siberian forest, no one has any obligation to respect my decision. It is entirely possible that in the future 90% of mining will happen in Iceland where the electricity is cheap. There could be great connection between miners, blocks could be bigger and allow a lot of transactions to be put in with lower fees. The rest of the world could download the whole chain without worrying about its delays and sizes. If you want to verify it yourself, just pay for the bandwidth and storage. There is no real threat that by being closer to each other, miners will form a cartel (they can do that today already). Even if they do, arbitrarily raised transaction fees would lower the market value of their own savings, and also any member of cartel can undercut everyone by dropping his fee requirements and earning much more than the rest of them.
What about poor geeks on slow connections with old clunky hard drives that protect our freedom by chatting on Bitcoin forums and sharing 0.0001% of a mining pool? They would need to adjust. Just like CPU miners were losing to GPU miners, and both of them — to ASICs, they would need to adjust to a bigger blockchain. This does not hurt anybody’s freedom except their own. Millions of regular customers would never bother downloading blockchain. They would either trust others, or use escrow payment systems anyway. And those people will provide real value on the market and will make sure that they have their connections faster, drives harder and operations as cheap as possible. Being a lonely chatty geek in Botswana does not bring any value to anybody.
If the miners hit the block limit, it would only mean one thing: there is a desire to process more transactions, but historical untested agreement does not allow it. Then miners and other full nodes will either raise the limit (the smaller the increment, the bigger support it will have), or transaction fees will go up as people compete for the space in blocks. As transaction fees go up, not only miners, but also regular users and service companies using the full blockchain would desire increment of the limit. So it will be even easier to achieve a consensus about raising the limit.
My prediction is that the block size limit will probably never be abolished, but will be constantly pushed up by a factor of two as amount of transactions approaches the limit. Maybe after a couple of updates, people would decide that it’s safe to abolish the limit completely if it is cheaper to account for it, than to have uncertainty of a hard fork.
There is no philosophy in Bitcoin. It is not anarchic, libertarian, Austrian or anonymous. It is just an internet protocol and a bunch of people that use it to transact between each other.
The protocol has purely technical and monetary measures to prevent spam, DoS, double spending and reversal of transactions. Transactions themselves do not advertise their purpose or identities of people involved.
It is not “against Bitcoin spirit” to have non-anonymous service built on top of Bitcoin. It is not a “hack” to use Bitcoin addresses generated not from random numbers, but from document hashes to implement secure document timestamping.
You can do whatever you want with Bitcoin as long as your transactions are compliant with the protocol and you pay the fees when needed. You can use it as a currency. Or as a payment system. Or as an investment. Or not use any of its monetary properties whatsoever, but use it to register predictions about the future. You can use it in clear to accept donations for a good cause, or you can use it through Tor network to buy illegal stuff. You may require others to identify themselves before accepting payments, or you may allow your customers to hide their identities from you. After all, you can avoid the whole thing completely and live a happy life.
If there is a single philosophical thing about Bitcoin, it is this one: voluntarism. On the internet, across oceans and thousands of walls, you cannot force another person to do what you want. And neither can he or she. Therefore, to make a deal with another person, you have to negotiate and find consensus. And if you envision risks and potential problems, you are free to creatively find voluntary solutions to them, which will also be part of negotiation. No amount of unilateral declarations, laws or appeals to objectivist philosophy will make another person send you bitcoins. Only negotiation and reasoning give you a chance to get what you want.
Murray Rothbard, “What Has Government Done to Our Money?”
Economists err if they believe something is wrong when money is not in constant, active “circulation.” Money is only useful for exchange value, true, but it is not only useful at the actual moment of exchange. This truth has been often overlooked. Money is just as useful when lying “idle” in somebody’s cash balance, even in a miser’s “hoard.” (At what point does a man’s cash balance become a faintly disreputable “hoard,” or the prudent man a miser? It is impossible to fix any definite criterion: generally, the charge of “hoarding” means that A is keeping more cash than B thinks is appropriate for A.) For that money is being held now in wait for possible future exchange—it supplies to its owner, right now, the usefulness of permitting exchanges at any time—present or future—the owner might desire.
It should be remembered that all gold must be owned by someone, and therefore that all gold must be held in people’s cash balances. If there are 3,000 tons of gold in the society, all 3,000 tons must be owned and held, at any one time, in the cash balances of individual people. The total sum of cash balances is always identical with the total supply of money in the society. Thus, ironically, if it were not for the uncertainty of the real world, there could be no monetary system at all! In a certain world, no one would be willing to hold cash, so the demand for money in society would fall infinitely, prices would skyrocket without end, and any monetary system would break down. Instead of the existence of cash balances being an annoying and troublesome factor, interfering with monetary exchange, it is absolutely necessary to any monetary economy.
It is misleading, furthermore, to say that money “circulates.” Like all metaphors taken from the physical sciences, it connotes some sort of mechanical process, independent of human will, which moves at a certain speed of flow, or “velocity.” Actually, money does not “circulate”; it is, from time, to time, transferred from one person’s cash balance to another’s. The existence of money, once again, depends upon people’s willingness to hold cash balances.
In Bitcoin all transactions and balances are visible to everyone. If you want to spend someone else’s coins, you just need to pick any unspent transaction, figure out a secret key and make another transaction moving money to some of your addresses. How hard can it be?
First of all, all transactions use elliptic curve crypto for creating public/private key pairs (ECDSA). The idea is that it is easy to compute a public key from a private one, but very hard to do it in reverse. Unfortunately, we cannot know for sure that in the future we will not discover a relatively fast way to find private keys. Also, there is already efficient quantum algorithm to do just that (provided you have big enough quantum computer).
But ECDSA public keys are not exposed. Every publicly visible address is a hash of a public key, not the key itself. More specifically, the public key is hashed with two algorithms: RIPEMD160(SHA256(pubkey)). If you wish to spend money from any given address, you not only have to find a private key, but also find a public key which produces the exact same address. It is called “pre image attack”. (Pedantic note: if you spend coins from an address, you expose its public key, so it is one more reason not to reuse addresses, but always generate new ones for accepting payments.)
Obviously, two different hash functions are used in case one of them becomes weak to preimage attacks. Lets say, you have efficient way to find preimages for RIPEMD-160 (faster than brute force). Then, you would have to attack SHA-256 in order to find its preimage. And even if you succeed there, you will have to start searching for ECDSA private key matching the SHA-256 preimage you have just discovered.
The interesting question is why these two specific hash functions were chosen? RIPEMD160 is nice because it produces the shortest possible hash among non-broken hash functions (which makes the address as compact as possible). But I couldn’t find any definitive answer why need for SHA-256 as well, so here’s my understanding.
Both algorithms are widely used and no weaknesses were found in them yet (although, there are known weaknesses in the reduced versions of them). Moreover, SHA-256 is designed in US by NIST while RIPEMD-160 in KU Leuven university in Belgium. In other words, both functions come from very different places and were designed for different customers. This reduces the likelihood of finding the common weakness and also acts as a precaution against potential backdoor left by US or EU.
In the end, all coins are available for everyone to inspect, but each address is protected by 3 independent unique algorithms. So if there is an intentional or accidental weakness in any of them, other two are likely to remain strong.
When talking about money, people usually say something like “money has no or very little direct use value and is only useful as a medium of exchange”. For instance, you value your silver spoon for its immediate use during the dinner, but the dollar bills do not have any value in themselves — they are useful only when there are other people around who are willing to trade some of their stuff for these bills.
Generally, people perceive Bitcoin as currency which makes them think that the same arguments about its value apply. That is, in itself Bitcoin is some digital dust which can only have value as a monetary instrument. But that’s not the case at all.
Bitcoin network has very interesting properties that allow you to use it not only as a currency. For example, the block chain (decentralized transaction history) is designed to be extremely hard to forge and very easy to verify. This, with some crypto features, allows it to be used for secure time-stamping, proving ownership of tangible property, decentralized DNS and new ways to sign contracts without having to fully trust any one party. Some of these things are already possible using existing software, some require already planned and compatible modifications.
These things are not possible with any commodity-based currency (metals or paper bills), but possible and very easy to use with Bitcoin. Just think about it: in case of a contract dispute, you can provably verify the details of some contractual agreement in a matter of seconds across the ocean to anyone, without sending paper documents with ink signatures by mail. The only requirement for this is to leave a trace of your contract up front in the Bitcoin block chain by making a small transaction back and forth to an address, uniquely derived from the document contents. It costs almost nothing, can be done in a minute and the trace cannot be forged or erased by anyone in the entire world.
Edit: rephrased a couple of sentences according to the comments on HN.
Disclaimer: in this post I’m not going to pretend that I don’t want to hurt anybody’s feelings.
Dear folks at Hacker News and around the web,
You sure like to discuss practical things instead of debating about abstract philosophy. When someone somewhere does some stupid thing, you are glad to find some optimizations and corrections to it. If the government tries to put a guy in prison for many years where he will be regularly raped, and then the guy goes mad and kills himself, you, of course, do not start questioning the whole situation. Instead, you want to optimize the flow of things. Fire this guy, change that law, complain here, petition there etc.
When anybody comes in and asks: why do you think it is better to fire this prosecutor and hire another (a “better” one) instead of just firing the prosecutor and not let that situation happen ever again in principle? What is the reaction of you, people? Your reaction is to downvote and let him know about all statistical models and wise books about how society needs to be organized to maintain rights, order, peace and, by the way, are you some kind of an crazy anarchist who knows nothing about how the “real” world works?
Ok, lets suppose we care about efficient organization. And models, and social sciences. I totally accept that and have no intention to disprove any of those. Because it does not matter.
How do you decide from a theory of something (lets say, a theory of evolution), that some people can put other people into jail? Also: how can you even study people’s choices (in economics and politics) without drawing a line (even a fuzzy one) between coerced behavior and free behavior? How do you know, what people generally tend to do or be, if somebody is constantly keeping a gun on the table?
Soon, unlocking the phones in US will be illegal. Do you know why it makes people angry? No, not because “It’s my property, dammit, I have a right to do what I blah-blah”. It is because of one-sided relationship. Nobody negotiated this decision with you. Some people somewhere talked about it and decided that. Some other people voted for some abstract ideas. Nobody made a written contract with anybody, and now you become evil person starting January 26 at 00:00 if you disobey. Did Apple or Google ask you how you feel about unlocking and made a contract with you? If yes, then you should obey agreement and protest the redundant laws. If no, then why did you enter the agreement? And if you think that agreement is void because you feel like it, then why do you complain when somebody writes the laws the way they like it? And if the contract sounds unfair and inevitable, then why is that? Isn’t it because you have no place to go and complain for real? Because courts and lawyers are part of a very expensive violent monopoly? So every silly EULA is not a negotiation, but a something like a threat of a very unequal fight in a very expensive court?
Asking yourself all these questions is the way to understand many problems that people ignore.
If you want to adjust existing laws and behaviors to make them more “efficient” for you or “society”, you are doing a very bad thing.
When you say “for copyright infridgement you should put in prison for 1 month instead of 35 years”, this is what you are saying in reality:
Many people accept these things, and I accept living with these people without feeling depressed too much. This is sad news, but it does not kill my soul. What really hurts is when people demonstrate sincere capacity for humility and love. When somebody kills himself because of bullying, and others feel depressed by it. And then they try to fucking adjust the murderous system to make it slightly less murderous. When you do that, you are a sick fucked up skin of a slave, not an independently thinking human being. First, prove the morality of what you are trying to modify. Then we’ll talk.
Next time, when something horrible happens, like a law saying “if you put a finger in your nose, we can impose a fine on you, and if you don’t pay, we will threaten to kill you”, then think about why is it good to even have a possibility of some people writing these things and some other people obeying them. Instead of discussing economical efficiency and how this will change the price structure and amount of unemployment around you.
There was a conversation on Twitter about this picture:
https://twitter.com/old_sound/status/291677199470297088
The guys did notice that not only this picture is funny for obvious reasons, but it also shows a general dismissal of latinos as a category. Which obviously shows that authors of such pictures are themselves racists.
So let me show what’s wrong here. The problem with racism is not in the racists themselves. They sure do harm, but they do not benefit from that. Racists of any kind alienate a significant portion of people creating a long-term economical and political problems for themselves. We all know how it works by numerous historical examples.
The root of any social problem is where the money is. In other words, who benefits? Well, that’s all kinds of political leaders: gangsters or government. They directly benefit by manipulating some crowd and making it spend their emotions on religion, racial differences, income classes etc. So whenever you feel that your feelings have been hurt by some racists, you know that there are evil people that want to smash together you and another emotionally-unstable person. If you think that by opposing racists you solve the problem, you are mistaken. By opposing racists you play the game that is designed to have just that: people attacking other people while someone else harvests obedience from them.
To win this game, you should not play it. There are racists, there are offended people. But what counts are actions: if you don’t wage a holy war back on your offenders, but protect real things: yourself and people around you on tangible grounds, not based on your race or religion, then you can avoid escalation and have a chance to show your enemies that the racism is just someone’s method to enslave them.
When you listen to a guy talking about Bitcoin, there are several things that come up frequently and that are not true. Unfortunately, even popular video on WeUseCoins.org says those things. So lets try to see what’s wrong.
1) “Bitcoin is a currency that is created by computers.”
As I explained in the previous posts, “mining” is absolutely secondary to Bitcoin. The most important thing is a decentralized history of exchanges that people can trust. That’s what makes Bitcoin interesting. You have much more freedom and much more protection to sign a contract with another human being. Without a single corporation, government, police and lawyers. And your contract will have to be acknowledged by everyone else contributing their own contracts. So all participating people are locking each other into mutual agreements in a very clever way, that nobody can escape them without paying for that. The word “currency” is absolutely a second part of the story. Since people normally want many different agreements, Bitcoin provides a numerical value on its contracts. Which makes it possible to trade them and use as a monetary instrument.
So it is not created by computers. It is automated by computers, but it is created and maintained by real people who want to trade with each other peacefully and efficiently.
2) “Bitcoins are sent directly to other people without someone in the middle.”
Of course, Bitcoins go through someone. And this someone is a “miner”, who validates transaction, puts it into the block and spends a lot of electricity to make sure some random person does not attempt to spend money twice or fool everybody around. It is a miner who gets transaction fees and also unlocks bitcoins as a reward for the clearing service.
The difference with a banking system, of course, is that miners do not have guns and thus cannot impose additional arbitrary rules without paying for them themselves. There are many of them, so you always can choose the one you like more. And that choice is already automated and optimized, so you don’t have to worry about it.
3) “There are no prerequisites.”
Of course there are. There is a protocol which is harder than any law in the world. If you don’t play along, nobody will give you a penny. You cannot press or threat people to change the rules. You absolutely have to play by the rules to get a cake. And everybody has to do exactly the same. No man can come in and say “this idea is interesting, but I’d like to adjust certain things in my, sorry, in everybody’s favor” - won’t happen.
4) “The total amount is limited, so the value always grows and you get richer.”
That’s true that supply is limited. But it’s not true that this is a reason why value is growing. Supply could have been linearly growing all the time, and it still could be a good deal (it’s just the fees would be higher). Or maybe not. The only truth here is that “growins value” is nothing but people’s desire to use Bitcoin more than yesterday because it is more efficient/cheaper/cooler/whatever than other alternatives. If one day it’s not the case, then the value will “go down” despite of the limited supply. Remember that nobody would need Bitcoin in the first place if there were no thieves on the streets and in the Central Bank. Everybody can just write their obligations on a piece of paper. So if that day suddenly comes, then Bitcoin will become nothing but a useless numbers.
Also, if suddenly people start saving Bitcoins and not selling them for anything in anticipation of future growth, guess what would happen? Nothing. Until somebody needs to buy something. You are not not buying computer this year because next year it will be more powerful and/or cheaper. At some point you need stuff to be done, so it will be done. And if Bitcoin owners do not do anything useful to each other, there is no point in having them. That’s why speculation is hard and only few cold-headed people are doing it more or less successfully. Others are enjoying building stuff and making themselves and everybody around richer and happier.
When people ask about how bitcoins are created, you reply that they are “mined” by computing millions of cycles of the same algorithm until a certain result is achieved. Basically, you spend time + electricity to generate new coins.
Then they ask you is it true that you do not create anything of value? And you honestly say, well, yes. Electricity is wasted on generating random numbers without any practical use, so there is no “intrinsic” value being put in the resulting coins.
This is of course not true. I can also burn electricity watching YouTube all day, but that won’t make other people pay me. The truth is what “miners” do is validating and securing transactions. That’s their main job that others are willing to pay for. That’s why Bitcoin has value.
Why is unlocking new coins tied to the block creation (“mining”)? Because, it’s the only logical place to do that. If you have a method to generate money, then people are supposed to do that like crazy provided that someone still processes transactions (which is the only reason to have any interest in the currency in the first place). So if I say, you should do these calculations to get new money, but to make transactions do those other calculations, nobody would care. But when you combine those two things in one single process, then you have a system with a “positive feedback”: people get reward directly and immediately for providing services for themselves and anyone joining later on.
So the value of Bitcoin is not in the cost of electricity, but in the ability to make safe and quick transactions and having a limited money supply. And the miners are not digging money from nothing, they are doing a service to everyone and are being paid for that.
Bitcoin “mining” is a process of creating hard-to-compute chain of transactions to make sure nobody tries to spend money twice. It is important because the chain is not stored on a trusted server, but rather copied thousands of times among all the computers in the network. The resulting structure is called a “blockchain”, that is a chain of blocks of transactions. As it is nearly impossible to change the history of payments (and therefore cancel transactions or double-spend bitcoins), users stay confident that the history of transactions looks the same to everyone. This is the central part of the Bitcoin protocol: a solid and distributed mechanism to verify validity of payments.
People who spend electricity to create blocks are called “miners”. They are paid for their trouble by transaction fees (offered voluntarily by others) and block rewards that are source of the new bitcoins. There is a limited number of bitcoins and all of them are distributed among the first several million blocks available to everybody to “mine”. That’s why the process of building the blockchain is called “mining”.
However, the term makes sense only within the earliest history of Bitcoin when there were almost no economy and no transactions, but only a bunch of geeks computing almost empty blocks for reward that they were trading for fun and a couple of cents. If you tried to find any info on Bitcoin in 2010, you would find mostly the info about mining. Back then a pizza was sold for 10000 BTC (https://en.bitcoin.it/wiki/History) and the whole project looked like a game.
Today there is a much more interesting economy, daily transaction volume is almost $3 million and rapidly growing, more than 50% of all bitcoins are mined already and the per-block reward has already been halved in December 2012 (as defined by the protocol). Blockchain is used for real transactions — purchases, currency transfers, investment, bets and all other things we use money for. Miners are making very real money which is a strong incentive to carefully include and validate all transactions to keep the value of the system growing.
So today it is a good time to remind ourselves and everyone that the Bitcoin is not about “mining” money. It is about verifying payments in a very secure manner, without trust in any authority, very quickly and efficiently. Mining is just a temporary effect of bootstrapping the next era in human kind.
For those who still think Dispute Resolution Organizations (DROs) will become governments, I invite you to take a look at a real-world example of a DRO – one of the world’s largest “employers.” Currently, over 300,000 people rely on it for a significant portion of their income. Most of what they sell is so inexpensive that lawsuits are not cost-effective, and transactions regularly cross incompatible legal borders – in other words, they operate in a stateless society. So how does eBay resolve disputes? Simply through dialogue and the dissemination of information (see http://pages.ebay.com/help/tp/unpaid-item-process.html). If I do not pay for something I receive, I get a strike against me. If I do not ship something that I was paid for, I also get a strike. Everyone I deal with can also rate my products, service and support. If I am rated poorly, I have to sell my goods for less since, everything else being equal, people prefer dealing with a better-rated vendor (or buyer). If enough people rate me poorly, I will go out of business, because the risk of dealing with me becomes too great. There are no police or courts or violence involved here – thefts are simply dealt with through communication and information sharing.
Thus eBay is an example of the largest Dispute Resolution Organization around – are we really afraid that it is going to turn into a quasi-government? Do any of us truly lie awake wondering whether the eBay SWAT team is going to break down our doors and drag us away to some offshore J2EE coding gulag?
Practical Anarchy by Stefan Molyneux
http://www.freedomainradio.com/FreeBooks.aspx (pdf, html, mp3)
Capitalize “Bitcoin” when speaking about the project or the protocol. Example: “We accept payments with Bitcoin”.
Do not capitalize “bitcoin” when speaking about units of currency. Example: “We accept bitcoins”.
Bitcoin-qt app stores private keys in ~/Library/Application Support/Bitcoin/wallet.dat
Make sure you encrypt your wallet (Settings -> Encrypt Wallet). Write down the password on a secret piece of paper ;-)
Make sure you back it up properly. By default, Time Machine should backup entire Application Support, but this would exhaust your backup disk quickly because it will continuously back up 3 GB blockchain. I recommend excluding every Bitcoin/* file except wallet.dat (see the screenshot).
Remember: if you lose wallet.dat, your money is gone forever.

Bitcoin is a peer-to-peer digital currency. It does not depend on any particular organization or person and it is not backed by any commodity like gold or silver. Bitcoin is a name for both: the currency and the protocol of storage and exchange. Just like dollars or gold, Bitcoin does not have much direct use value. It is valued subjectively according to one’s ability to exchange it for goods.
This FAQ complements the bigger Bitcoin FAQ: https://en.bitcoin.it/wiki/FAQ You may start here and then proceed with Bitcoin Wiki for more details.
If you have already heard of Bitcoin mining and exchange, or you would like to know more about it, see below “Who is interested in Bitcoin?”.
Bitcoin is designed to be a faster, cheaper and a more secure currency. It is fast because verification of transfers is completely automated and does not involve human supervision. Security is achieved by having every participant do the verification himself using well-known cryptographic methods. Bitcoin is designed to prevent double-spending, stealing and creating money out of nothing. The original software source code is open and available to everyone for review and improvement.
Bitcoins do not exist as distinct items of information. They only appear as records in a global transaction history that is stored and synchronized between all participating computers. Transactions are grouped into blocks that are cryptographically signed in such a way that they are computationally hard to produce. Such scheme guarantees that no one can revert a transaction or double-spend bitcoins.
To own and spend bitcoins each participant only needs an address and a corresponding secret key. This key allows to send bitcoins from that address. To receive bitcoins a key is not needed; you only need to give the sender your address.
A person may have unlimited addresses and keys. A collection of keys is called a wallet.
Keys are used to sign new transactions in order to verify the ownership of the address. Then every client in the network can verify that the signature is valid and that the entire chain of transactions is done by actual holders of their keys. Therefore, one may steal bitcoins only by stealing secret keys.
Bitcoins are not created upfront and distributed to some privileged persons. Instead, they are given as a reward to anyone for verifying and securing transactions. Transactions are secured by being put into blocks that are computationally expensive to generate. People who create blocks are called miners.
The reward for creating a block is contained in the first transaction that sends 25 BTC from nowhere to any address chosen by the creator of the block (reward was 50 BTC before December 2012).
The reward is halved approximately every 4 years until a total of 21 million bitcoins are generated around the year 2140. More than 10 million bitcoins are available already. Every participating computer checks that the reward is generated at a constant speed and has a correct value. See the chart here:
The minimum amount of bitcoins to be transferred is 0.00000001 BTC. This gives more than 2000 trillion of smallest units. If everybody finds it useful in the future, the format can be changed to allow even smaller values.
No. Bitcoins are not printed, they are earned. In a way, all 21 million bitcoins already exist. You may earn them through an exchange or by validating and securing transactions. The rate at which new blocks are created is kept more-or-less stable by the protocol, so everybody can accurately account for money supply changes.
The supply is designed to be constant in order to avoid undermining the value of Bitcoin in favor of less inflationary instruments (e.g. physical gold). At the same time, bitcoins are introduced gradually to motivate early adopters to create a secure and efficient network.
There are normally three reasons why people get interested in bitcoins:
An “average” person can safely ignore the first two reasons.
Mining, the process of creating blocks of transactions, was possible on a home computer some time ago, but now it is profitable only using a custom-designed hardware. Bitcoin network adjusts the difficulty of mining to keep the rate of block creation constant (6 blocks per hour). As more people are throwing their resources into mining, the process becomes more expensive.
Speculation on currency exchange is also very competitive and does not significantly differ from any stock market.
Therefore, this FAQ focuses on the third reason: using Bitcoin in exchange for goods and services.
Bitcoin is a very young currency launched in 2009, but it already covers a surprisingly wide variety of goods and services. You can pay for personal services, buy digital and physical goods: books, games, movies, etc. So far you cannot buy groceries, but some coffee shops and restaurants already accept bitcoins.
There are wallet apps for computers and smartphones. There are different ways to buy bitcoins offline in physical form. Several companies develop processing services and debit cards. Right now Bitcoin is not always convenient or easy to use, but the trend is very strong towards more and better services.
See a list of places where one can buy, earn or spend bitcoins:
You need a software or a web service in order to manage your wallet and make transactions. A wallet is a collection of private keys (like passwords, but much longer), it does not contain any bitcoins itself. Each Bitcoin address has a corresponding private key that allows you to send money from that address. Addresses and keys are free to create and anyone can have as much of them as they want. To increase privacy, it is recommended to use a new address for each transaction. Popular Bitcoin software does that for you automatically.
Unlike Visa, MasterCard or PayPal, all Bitcoin transactions are final and cannot be reversed. Chargeback thus can only be performed through the good will of the seller. On the other hand, Bitcoin transactions do not only express transfer of funds, but they can also express complex contractual agreements. For instance, one can create a transaction between a seller, a buyer and a mediator. If the seller and the buyer agree on a transaction, the mediator cannot cancel it. But if there is a conflict, then the mediator may side with either buyer or seller to decide who receives the money. In this way Bitcoin provides a much stronger protection against fraud without a requirement to trust the mediator. This idea may be extended to a larger amount of participants to facilitate collective fund raising or insurance.
See the discussion here:
Bitcoin is certainly in a “grey area”. So far no attempt has been made to penalize bitcoin users. However, certain activities that are illegal with other currencies (fraud, money laundering, illegal purchases, etc.) are illegal with Bitcoin as well. Since some central banks may see Bitcoin as a competitor that undermines their control over money supply, one may expect laws affecting Bitcoin in the future.
Bitcoin requires access to the internet and a special software to create and verify transactions. To stop people from using Bitcoin, one would have to suppress communication channels. Bitcoin is facing the same risk as any other internet protocol: being filtered or denied by the internet service providers. However, there is no single organization to shut down to cause major disturbances in the network. For example, if a popular currency exchange is closed, one can always use another exchange service or even trade in person. In a sense, Bitcoin is as difficult to shut down as BitTorrent.
The value of Bitcoin (and all the other goods for that matter) is purely subjective and depends on each individual valuation. Of course, the valuations may be aggregated and averaged, but they all stand on a shaky ground of each individual’s decision to buy or abstain from buying. The same applies to dollars, gold, oil and groceries.
There is no objective value of Bitcoin, but there are several common reasons why people use it. First, every day Bitcoin proves itself as a robust registry of money ownership: nobody can revert transactions, freeze accounts or take somebody else’s money. Second, it provides better privacy than modern banking. Third, there is no risk that some day the amount of bitcoins has suddenly increased and your savings have lost their value.
Yes. Early adopters took the risk of spending their time and energy on a project, which turned out to be useful for the people who joined later. The more confidence people have in the network, the more they are willing to invest in it, thus increasing the Bitcoin price.
No. Bitcoin does not promise any dividends. There is no central issuer and anyone who generates bitcoins makes the process more expensive for himself and the other miners, but at the same time increases reliability of Bitcoin for everyone.
Just like any other currency or stock, Bitcoin is also subject to speculative bubbles and bursts. Part of its value is based on the willingness of the users to spend and receive, while the other part is based on the anticipation of an increase or decrease of such willingness. If that anticipation grows too much, Bitcoin may quickly gain in value until no one will want to buy it anymore. Then the people will sell until the price goes down to a “normal” level. These speculative spikes will get smaller as the market grows and each individual share of bitcoins decreases.
Some people are spending their energy printing metal coins with sophisticated patterns to make forgery more difficult. This activity is useless only if nobody wants to buy or use these coins.
Transactions are secured by putting them into blocks that are computationally expensive to generate. One has to spend time and electricity to verify and secure transactions to prevent double spending and illegitimate creation of money. Bitcoins are supplied as a reward to those who spend their resources to keep the network secure while it is young and growing. Money is not added because some amount of electricity is spent. It is electricity that is spent because people are demanding that much security and quality from the network. Automatically adjusted difficulty ensures that the amount of power to be spent is determined by the current demand in bitcoins, no more no less.
By design, every transaction may include a fee for it to be included in a block. Right now this fee is usually zero for big enough transactions and insignificantly small for small transactions (in order to prevent spam). When the reward gets smaller, these fees will become the main motivation for generating blocks.
Blocks appear at a constant rate (6 blocks per hour) and every block has a limited size (1 Mb). Today the typical block size is 50-200 Kb. When the rate of transactions increases, they will start competing for a place in a block. This will in turn increase the average fee. The protocol may be changed in the future to allow bigger blocks.
If you are not generating blocks, you will not spend much electricity. To store bitcoins you only need a wallet with secret keys. To transfer bitcoins you need an application that synchronizes transactions with the rest of the network. To do both you may use an app for your computer or a mobile phone, or a web service.
No. The payment is sent by relaying a signed transaction to the network. All you need to do is to give another person one of your addresses to send bitcoins to. To verify the payment, you can check the transaction status on or using a similar service. Digital signature is required only for spending bitcoins, not receiving them.
Even if you use a debit card with an escrow service that holds your keys, you will still benefit from the more competitive and non-inflationary nature of bitcoins. You may keep most of your savings on your personal computer, or transfer them easily and at low cost to any escrow in any country. Every escrow service in the world will need to compete with each other and with those who hold bitcoins by themselves.
Transactions are secured by being included in a block. Blocks are generated approximately every 10 minutes. Including the time to propagate a transaction through the network, today it usually takes about 15 minutes to verify inclusion in a block. For better security, one can wait until more blocks are added after the block with the transaction.
Transactions are grouped into blocks and each block contains the signature of the previous block, thus making up a chain of blocks.
The security of the system is based on computational difficulty to generate blocks parallel to the main chain. The more blocks are created after the block containing your transaction, the harder it is to fork the chain and make the transaction invalid. Therefore, no transaction is 100% confirmed. Instead, there is a confirmation number — a number of blocks built after the transaction. Zero confirmations means that the transaction is not yet included in any block (unconfirmed). One confirmation means that the transaction is included in one block and there are no more blocks after it yet.
Today for small transactions one or two confirmations (10-20 minutes) are considered enough. For bigger transactions it is recommended to wait for at least six confirmations (1 hour). One known exception is 120 confirmations required by the protocol for the use of generated bitcoins. This is because miners (those who create blocks) have the most of computing power in the network and must have extra incentive to play fairly and generate blocks in the main chain without attempting to double-spend their rewards.
Each block has a cryptographically signed reference to the previous block (parent). This way blocks form a chain. It is perfectly possible to have two blocks referencing the same parent block (the chain is forked). In this case we can think of two parallel chains diverging at some point. The main chain is by definition a chain of blocks with the maximum total difficulty.
Whenever miners accidentally generate parallel blocks, only one of these blocks is considered to be a part of the main chain. If later more blocks are added to some other block, then that block and all blocks after it will become part of the main chain.
The reward for the block and transaction fees are valid only for the blocks in the main chain. This motivates the miners to build on top of the main chain and avoid creation of parallel blocks. Otherwise, it is simply a waste of time and electricity if the block becomes abandoned by the network.
The transactions that are not in the main chain are not lost. All valid blocks (including the abandoned ones) are distributed among participants in the network.
When it is evident that some block will never again become a part of the main chain, a miner will interpret transactions in that block as unconfirmed and will include them in his new block. This means that now they collect the fees from these transactions while the owner of the abandoned block does not receive the 50 BTC reward or the transaction fees.
For the person who made the transaction this means an extra delay in the transaction confirmation (typically 10-20 minutes).
Bitcoin is not anonymous, but rather pseudonymous. All transactions, addresses and amounts are visible to everyone. But every address is just a random number and is not associated with an identity unless deliberately revealed by its owner. If one reveals that they are an owner of a particular address, then everyone will be able to see the chain of transactions involving that address. Addresses are free to create and it is recommended to create a new address for each transaction. This makes it hard to track how many bitcoins one has or where they are sent to or received from.
To further increase privacy one may use “laundering” servers. The servers randomly exchange bitcoins between all their users in order to make it more difficult to trace their source. In the jurisdictions that prohibit laundering money, some people use online casinos as a plausible way to clear the trace of money at the expense of about 10% of the amount lost in gambling. But if you are not doing anything illegal, the usual level of anonymity provided by changing addresses should be enough.
Miners create blocks. To create a block one needs to create a file containing unconfirmed transactions (that are not yet included in any other block), add a timestamp, a reference to the latest block and a transaction sending 50 bitcoins from nowhere to any address. Then, the miner needs to compute a signature for the block (which is basically a very long number). This signature is called hash and the process of computing is called hashing.
Computing a single hash takes very little time. But to make a valid block, the value of its hash must be smaller than some target number. The hash function is designed to be hard to reverse. That is, you cannot easily find some file contents that will produce the desired hash. You must alternate the contents of the given file and hash it again and again until you get a certain number. In the case of Bitcoin, there is a field in a file called “nonce” which contains any number. Miners increment that number each time they compute a hash until they find a hash small enough to be accepted by other clients. This may take a lot of computing resource depending on how small is the target hash value. The smaller the value, the smaller the probability of finding a valid hash.
There is no guarantee that you need to spend a certain amount of time to find a hash. You may find it quickly or not find it at all. But in average, the small enough value of block hash takes time to create. This constitutes a protection against creation of a parallel chain: to fork the chain you will need to spend more resources than the people who created the original blocks.
Here are some parameters of the Bitcoin chain. They may be different for alternative currencies based on the Bitcoin software (like Namecoin).
Points #5 and #6 imply that the total number of bitcoins will not exceed 21 million.
It is a limitation of a transaction format (amount is a 64-bit number). This can be changed in the future if people will need to send smaller amounts.
The 10 minute interval is designed to give enough time for the new blocks to propagate to other miners and allow them to start computation from a new point as soon as possible. If the interval was too short, miners would frequently create new blocks with the same parent block, which would lead to a waste of electricity, a waste of network bandwidth and delays in transaction confirmations. If it was too long, a transaction would take longer to get confirmed.
The block size is limited to make a smoother propagation through the network, the same reason why the 10 minute interval was chosen. If the blocks were allowed to be 100 Mb in size, they would be transferred slower, potentially leading to many abandoned blocks and a decrease in the overall efficiency.
Today a typical size of a block is 50-200 Kb which makes a lot of room for growth. In the future it is possible to increase block size when the networks get faster. Decreasing time interval would not change much because the security of transactions depends on the actual time, not the number of blocks.
The difficulty of mining is adjusted every 2016 blocks (approx. every two weeks). This gives miners enough time to adjust their hardware, but at the same time prevents the blocks to be created too quickly as the total computational power grows.
Initial reward of 50 BTC is purely arbitrary. If it were 500 BTC, then it would not change anything in the market structure, just change the nominal prices by a factor of 10.
According to the Austrian theory of money, any money supply is “good” in a sense that any differences in money supply are purely nominal. If everyone suddenly wakes up with twice as much money in their wallet, it would not change anything in the world since the money has almost no direct use value. What matters are the relative differences in amounts.
If Bitcoin allowed unlimited mining, it would allow perpetual shift of wealth from productive uses to miners. As a limited commodity, Bitcoin itself does not encourage any particular type of work. By being neutral, it appeals more to non-miners, than it would be otherwise.
Mining rewards are decreasing (instead of being constant) to motivate earlier miners to secure the network while it is young and more vulnerable.
The reward is changed every 210 000 blocks (about four years) to ensure an optimal growth of the network. If the interval was too short, all the bitcoins would have been generated too quickly before a wide network could be created. If the interval was too long, then it would have effectively decreased the reward of the early adopters making the network more vulnerable.
The protocol is a list of rules that every client must follow in order to validate transactions and have their transactions validated by others. Hence, if you change the rules for yourself, other clients will simply reject your transactions and you probably will not be able to accept theirs. This makes it hard to change the protocol.
If there is a change that a vast majority of clients will find useful, then it is possible to publicly agree that starting with the block number X, new rules will apply. This will give a certain amount of time to everyone to update the software.
Please send your questions and comments here: oleganza@gmail.com
Twitter: @oleganza
If you like this FAQ, you may donate 0.1 BTC on this address: 1TipsuQ7CSqfQsjA9KU5jarSB1AnrVLLo.
Scrypt uses a very big vector of pseudorandom bit strings. Straightforward implementation generates vector once and uses it to generate keys. To efficiently parallelize computation, one must spend a lot of memory or compute elements on the fly. The trick is that the whole vector itself is very expensive to compute, which makes it more generally efficient to perform computations on a single CPU using a single vector.
The message-eating nil is a built-in or optional feature of some programming languages that lets you ignore message execution on nil (or null) object. Objective-C does that. In SmallTalk, Ruby and some other languages you can add this behaviour in runtime.
Why is it useful: for instance, accessing person.address.street_name will simply yield nil if either person, address or street_name are nil. Another example is iterating nil instead of a list without checking if it is nil.
Some like message-eating nil because it saves a lot of boring code and helps avoiding some silly crashes. Others dislike the feature on the ground that it hides errors and makes it more difficult to reason about all the code paths.
However, here I present a definitive answer to the question whether your next programming language should or should not support message-eating nil.
Nil should be message-eating.
Here is why: when you switch from a language without message-eating nil to the language which has one, you only spend a week or two adapting to the new style and being puzzled from time to time where the hell the data is missing. After a longer period of time, you will change your style and find it useful and easy to program using this feature. But when you switch from such language to the one without message-eating nil, you will notice just how much useless if/then conditions are being added in your code. And when you forget adding one somewhere, you will get silly crashes in production code. Silly because you already know the nil would have been handled if it was allowed to be propagated.
Please, allow nil to eat messages.
PS. If you think of adding message eating to NilClass in Ruby, remember that metaprogramming can be dangerous.
Xcode 4.4 is capable of subscript syntax and allows migrating the code from [arr objectAtIndex:0] to arr[0]. A few tweaks needed, however:
1. While OS X 10.8 SDK already contains objectAtIndexedSubscript: and objectForKeyedSubscript:, iOS 5.1 SDK does not. To make compiler happy, you should add this:
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
@interface NSDictionary(IGSubscripts)
- (id)objectForKeyedSubscript:(id)key;
@end
@interface NSMutableDictionary(IGSubscripts)
- (void)setObject:(id)obj forKeyedSubscript:(id )key;
@end
@interface NSArray(IGSubscripts)
- (id)objectAtIndexedSubscript:(NSUInteger)idx;
@end
@interface NSMutableArray(IGSubscripts)
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx;
@end
#endif
2. To deploy new stuff back to iOS 5 and iOS 4, you need ARCLite. Somehow ARC itself works without extra configuration, but subscripting requires explicit linker flag:
In project settings add to Other Linker Flags: “-fobjc-arc”
3. If you use Edit -> Refactor -> Convert to Modern Objective-C Syntax, it will replace -[NSLocale objectForKey:] with a square brackets syntax, which is not supported by NSLocale. This is the only bug I have found with the automatic translation. NSCache and NSUserDefaults are not touched by the migrator.
The problem is that it is not supported by anybody except for the rare libertarian thinkers. Here’s my (very inaccurate) demonstration of common types of mindsets showing why it is so.
Entrepreneurs by the very definition of their job have to deal with whatever situation is at hand and not waste time discussing political philosophy. They need to get the job done within an existing framework, whether it is a monarchy, democracy or socialism. Theory of justice is not a good guidance, especially if it goes against the existing rules. Entrepreneur tends to be efficient first, moral second. Otherwise the more efficient one will take his place. Entrepreneur’s perspective is solely from his own enterprise and its profitability. If it is not so, there will quickly come another one, more focused and more efficient to win the customers.
Politicians by definition oppose libertarianism. Politicians fight for power, their piece of the pie. While the entrepreneur tries to maneuver within the existing rules as efficiently as possible in order to create his product, the politician is interested in changing or creating rules according to his own ideas of what’s good and bad. (Sure enough, a single person may combine both roles, but it is useful to analyze them separately).
Regular wage earners do not fight for power like politicians, nor do they build their enterprises and products. They focus on their own work and life and prefer a stable income. Those of them who are interested in any social philosophy are not going to like libertarianism very much for it does not promise them anything in particular. Every politician, left or right, promises safety, stable prices and free stuff, but only a libertarian will promise you that you are going to earn what you deserve, no less, no more.
Who remains then? Those people who are not starving, who have the time and cultural background to study things, who have no desire or skills to fight for power or bring about a particular enterprise, are in a most favorable position to start learning libertarianism. And still many of them would not be convinced at least for the reasons outlined above.
Here are the implications of this realization. First of all, there is no threat (or hope) that the libertarian movement will suddenly make a big impact. Then, those who have any interest in libertarianism have to admit that they will not attract many supporters due to the very nature of the theory. When people say that libertarians “define their reality in their own head” it is a sign that they are not interested a priori. There is little hope that people will “get interested” if you repeat your idea over and over again. This just pisses them off. Look at the people around you: everybody is interested in their own benefits (material or psychic).
A socialist who promises a particular policy and particular effects based on carefully chosen historical data points is by far more efficient in convincing a random person than a libertarian who carefully analyzes the nature of all human actions and then comes up with something vague and unimpressive like “everybody will be able to freely pursuit their own happiness”. To believe a socialist you just need to be convinced by some data points and concrete goals. But to believe a libertarian you need to study all that stuff yourself because on the surface it looks either “crazy” or “simplistic”. Not many people have the time and energy to even try.
People discuss how Apple has plenty of room to grow by indicating market share in terms of units which is very small (less than 10% among mobile phones). However, the only correct way to predict growth is by looking at the revenue. And not only Apple’s revenue, but also at the general money supply and revenue distribution in all other industries and/or competitors.
First of all, units do not tell you much. There are very different categories of products and prices hidden behind the units. A person who buys a $50 phone does not usually consider buying an iPhone for $500. Or he may consider buying an iPhone instead of buying a cheap phone, handheld game console, wristwatch, a calculator and a flight to visit parents. We cannot predict anything here in terms of units because we cannot compare things in aggregate — only individuals may compare importance of particular units for themselves.
Fortunately, in our economy we already have an efficient instrument: money. We use money to exchange units of any good imaginable. Each person allocates his money to various needs according to his personal subjective valuation. First, he allocates money to the most urgent need, then to less urgent and so forth. So one might prefer paying for his wedding ring instead of an iPhone this month while another one will decide to pay for an Samsung phone instead of going to a hairdresser. These seemingly incomparable things are comparable only through the money allocated to them. When masses of consumers increasingly prefer one product more to all other possibilities to spend their money, you get a nice growing revenue chart.
This means, a revenue is an indicator of how much value all consumers put on your product. What is a revenue share then? First, it depends on how you define the market, that is what products you compare your product with. In case of iPhone, it could be a mobile phone market: all the money people spend on mobile phones.
Today Apple has about 8% unit share and 40% of revenue share in mobile phones. This tells us that so far people spend 40% of their “phone budget” on iPhones and 60% on other phones.
So how do we know how iPhone sales will behave in the future? Revenue share is not enough to decide as “phone budget” may grow or shrink comparing to other goods. We need additional charts for all other possible goods people spend money for. So if we see that people allocate less for gaming devices (and other specialized gadgets replaceable by mobile apps) we may guess that they will spend more on an iPhone as a replacement. But if at the same time they spend more money on food, water and guns, it might mean they are preparing for bad times and iPhone sales won’t grow much.
So Apple’s room of growth today is determined by how much money people are willing to give them comparing to all other possibilities. Thus, we need to understand the whole market: sales of related gadgets, rent prices, migration, inflation etc. And 8% of mobile phone units tells us a lot less than 40% of mobile phone market revenue share and a general mobile phone market growth (which is total amount of money spent on all the phones).
So if in two years people will allocate on phones in general twice as much money as today and if they will spend on Apple phones twice as much money they spend today, Apple will get 80% revenue share and 4 times bigger revenue.
What about profits? Apple is said to gain about 75% of the profits. This does not tell us much about future growth direction, but rather the speed and precision of that growth (or decline). Profits show efficiency of the company. Today Apple is more efficient than others, so it’s getting more money back to reinvest into production. Meaning it has a stronger influence on the market than other companies, but it still does not mean in what direction it will go as it is up to consumers and Apple shareholders and management to decide.
What about “every phone will be a smartphone”? Well, if 80% of people still prefer to pay very little for their phones (that are becoming smarter over time) and Apple is still having a high price for iPhone, the unit share will not change dramatically. On the other hand, if Apple invents an iPhone which replaces your car and a wife at the current price, their unit share will increase significantly as people will rush to pick a $500 iPhone instead a car or a wife if it can replace both of them.
John Gruber writes:
I’ve always thought Apple’s cash hoard was about freedom. That cash meant — and means — that they don’t have to answer to anyone. […] Apple can’t control its stock price; that’s in the hands of investors. But it can control how much cash it keeps in reserve. If investors sour (or the market crashes) and the stock price dips, Apple could take itself private.
This quote is a good example of a common misconception about who really owns the company. It is in fact, shareholders who own and control company. They are simply happy to delegate that control to current board of director for as long, as it is doing great. But when it doesn’t, it’ll quickly be replaced and shares will be sold to less pessimistic people.
About freedom: it only makes sense to speak about freedom where some coercion takes place. Like government regulations and taxes or somalian piracy. Otherwise, it’s all about mutually-benefitial partnerships. Better cash just helps negotiating things, but it does not buy any more freedom from any of the partners.
Apple is not even an acting entity. It’s a mode of acting of a group of people: shareholders, directors, employees. The company is used only to pool investments and limit liability of the owners and employees. And the real owners of the Apple assets are, of course, shareholders.
Therefore, Apple cannot get “free” from “investors” by buying itself and getting private. Tim Cook and others may buy Apple shares for their own money, but Apple’s cash does not belong to them at all.
Today shareholders are happy with what Tim Cook is doing. If tomorrow he announces a really stupid way to use company’s cash, owners will either sell shares or put another board of directors and CEO.
What Apple can really do? They can invest into a startup, people, factories etc. They can buy government to liberate themselves from regulations and taxes.
They can also pay dividends, but that is not a smart thing to do. There are only two ways you can spend dividends: consume them or re-invest in some other companies. While Apple is the fastest and biggest growing company, it makes very little sense to invest dividends into something else or to consume them. See also: Dustin Curtis on the subject.
It’s quite self-evident that many developers think that good tools “attract” developers to the platform and increase business prospects. But that is of course bullshit.
Microsoft, Apple, Google are not in business of selling developer tools. They sell their actual products to actual customers and optimize their production process to make their products better.
Improvement of a developer tool is not a function of your, developer’s, satisfaction and productivity. It is a function of your productivity and whatever design choices the company makes about their actual products. So you are only one part of equation. And normally, the smaller one.
If the iPhone is memory- and CPU-constrained, Apple is free to decide to not use a garbage collection and thus make developers less productive. They might lose non-paying developer (who potentially would’ve written a killer app), but would gain real paying customers.
Now, from the developer perspective, they are in the business of making products for people, not coding for fun. So they need a platform with a demand for their products. (Those who code for fun do not affect business decisions anyway.) A tool quality here plays only a role of production costs like many other costs. If the tool is so abysmal that its productivity cost consumes all the profits, then the platform won’t attract a developer. But if it’s good enough, it’ll be of course used provided the platform brings income to the developer. In other words, the primary force is the customer demand for vendor’s and 3rd parties’ products. Every other factor is a secondary.
Here’s a quite recent quote:
“But for now, Objective-C remains difficult to approach; only the appeal of writing hit iOS apps seems to be driving its popularity.”
Actually, the only purpose of Objective-C is to write hit apps (and the only purpose of apps is to satisfy paying customers). And if it remains “difficult to approach” for you, then you in particular do not envision some particular app worth writing given the current costs of mastering the tool.
Some people are asking Apple to fix the Radar. They demand a better UI, ability to open and comment on some bugs, integration with Xcode.
This is such a bullshit. Developers do not need a radar. Apple needs it. And they make it good enough for themselves, not for 3rd party developers. If the UI sucks and they get 10 times less bugs than people would love to file, it must be something they are okay with.
I personally, never care much about radar. If I noticed an annoying issue worth filing, I would file a bug in a minute and be done with that. I don’t care about browsing existing issues and figuring out if there’s already a duplicate. It’s not my job, after all. Apple guys should know better which bug contains new info and which is a pure duplicate. They deal with multitudes of product versions and different devices. I just have a couple of devices in some particular configurations.
Radar is a black hole. It would be more comfortable to get a quick response like “yes, we care, stay tuned”. But what for? Apple told us many-many times: please file radars, we keep track of all of them and nothing gets unnoticed. Do you really need this statement to be repeated for every request? I’m happy with “fire and forget” method: I spend very minimal time “managing bugs” and Apple somehow is able to fix the problems over time. They won’t tell you their roadmap anyway, so what feedback do you want after all?
Imagine Apple allows discussing radars in public. Now, instead of that many individual “votes” carefully filed by developers and classified as duplicates by Apple engineers, there will be less individual bugs and those will be covered with less informative comments like “me too” and “+1”. Essentially, that would mean that not Apple, but most active users are now classifying the issues, which makes Apple less efficient in figuring out their priorities. And the “most active developers” is absolutely not the same as the “most paying customers”.
Better UI and Xcode integration. Apple just needs UI suitable for their own comfort, not more. If they make UI very slick and fast, much more people will file the same issues and Apple engineers would have to sort out much bigger pile of duplicate bugs. And do not forget that every feature is a responsibility. Do they really need to constantly spend more time on a fancy bug reporting UI when the existing one works just fine?
Conclusion: file bugs if you wish and forget about them. When submitted, it’s now Apple’s job to deal with them. If you want to participate beyond that (that is, fix the bugs), then you already know what to do.
Following the discussion on Hacker News how MS had resources and liberty to experiment with their developer tools, but the new Visual Studio 11 is committee-designed and is based on the same crufty UI which is many years old now.
Both Apple and Microsoft are free to throw away old problematic UI and rethink some parts from scratch. If anybody is hurt in the process, it’s not a bottom line. Microsoft sells Excel and Apple sells computers, they don’t have to prove anybody anything with their developer tools, except for themselves. And they have all resources and expertise for that, of course.
However, there is a difference in approaches. Apple, comparing to others, is not afraid to break things while executing some ideas they think are great. For instance, when Xcode 4 was released, it integrated Interface Builder very neatly into main window, but they broke support for third-party UI components. So while some people would have to type a bit of boring code to setup those components, many others are enjoying unified workflow. Also, the first builds of Xcode were very slow. Xcode team found a way to represent tons of useful information in only three panels with very little cognitive load, but didn’t take time to optimize the performance. It was super-useful and super-annoying at first. But that was a non-trivial decision from their part.
When Apple released Final Cut Pro X with awesome new design, increased productivity and 70% price drop, they omitted some very important features. They finally added missing stuff, but before that they got a huge shitstorm from the customers for not having all they needed from the beginning.
As with Xcode 4 and FCP X, nobody was forced (even in a weak sense of this word) to upgrade. Xcode 3 worked well (I was using it while working on a slow notebook), FCP 7 was not killed too. What Apple had is basically a courage for an “release early, release often” type of operation. Why did they make these particular compromises, not the others? It was important for them to make a great new design and try it out as soon as possible at full scale. There is absolutely nothing interesting in performance optimization and bug fixes. You already know it’ll be awesome if you do them.
When you are designing, you are taking risk to decide for others and you don’t know if your are right until you show it. It also means, you cannot ship half-designed product. The reaction on unfinished design (non-thought through, that is) is skewed. It does not help you to understand if you made it right. It’s not a problem if it’s slow and buggy, those things do not obscure (at least, should not obscure) the vision of how product works.
Since you have to spend time designing every aspect of the product to the last detail to get sensible feedback, you don’t have much time left to resolve less relevant issues. You are already quite late, for that matter. And if your decisions need some improvement it’s better to know it before you start optimizing them.
So in the end, every new Apple product has what they consider a finished design with new ideas, but with rough edges like crashes, performance issues or some less relevant features omitted to be reworked later. Those having time to polish secondary aspects of their products are not pushing forward hard enough.
If you like the post, follow @oleganza on Twitter and buy my well-designed version control app: Gitbox. It’s super-smart, fast, and, of course, sometimes buggy ;-)
If you define some variables in projects settings that are included in Info.plist (usually, it is build version), you may notice that Info.plist is not always up to date. This is because when you change the variable in project settings, the Info.plist is not actually modified and Xcode may skip its compilation.
If you try to add Run Script phase with “touch $PROJECT_DIR/Info.plist”, it won’t help much because it will always run after processing of Info.plist. At best, Info.plist will be up to date every other run. It is very confusing to say the least.
How to fix:
1. Add a new target “Other” — “Aggregate” with a name “TouchInfoPlist”
2. Add Run Script phase with this line: touch $PROJECT_DIR/Info.plist
3. Go to your actual product targets, select Build Phases tab and add dependency TouchInfoPlist.
4. Edit schemas and remove schema “TouchInfoPlist”. You’ll never need to run it directly.
Enjoy always up to date Info.plist.
Apple has a lot of great documentation: from the very basic guides and tutorials down to particular API references. But for a very long time newcomers were wondering: where should I start?
Now you know the answer:
For iOS: Start Developing iOS Apps Today
For OS X: Your First Mac App
iOS guide is even better: it shows you all necessary areas from the beginning to the end giving relevant links at each step. Just start with first page and move on.
Yesterday you had many great ways to create and digitally distribute your content. First, you could make a website with gorgeous latest web-technologies which is perfectly accessible with every modern browser on all major computer platforms. Or create an ebook based on the open standard Epub, also supported by all major reading software and devices. Third option is to make a movie (encoded in a couple of wildly supported video formats: from FLV to H.264 and Ogg). Finally, you could write a native app for Windows, Mac, iOS, Android etc.
Every platform vendor: Microsoft, Apple, Google, Facebook, Adobe and others work hard every day to give you better ways to create and communicate with people.
Today Apple released three apps: iBooks 2, iBooks Author and iTunes U. Every app is available for free. iBooks now runs interactive books created with iBooks Author and iTunes U integrates books and apps with video materials in a very useful UI.
So today you have one more wonderful option in addition to those listed above. Yet, some people start screaming about “lock in”, how Apple does not care enough about education to make everything open; about many evils of proprietary formats, proprietary apps, proprietary operating systems and proprietary devices.
These people are fantasizing a world where everything is right, cheap and every good is available in an infinite number of options. And at least one of those options is exactly what is right for them (and there must also be a right one for any other person too for fairness’ sake).
Guess what. This is the world we are living in. And everybody has her own idea of the perfect world order and while we are not enslaving or destroying ourselves, our world indeed moves towards better ways to live a life. Nothing is 100% right for you, but it is so for everybody. And this is why we all are working together everyday to make us happier.
Today’s Apple announcement is just one more achievement of human civilization, in addition to iPad, Android, Windows XP, World Wide Web, printing press and alphabet. Choose what you like in any combination and go do something great with it.
I have a single-core chip on iPhone 4 and an app with OpenGL rendering controlled by touch events.
This morning the app was rendering graphics on the main thread. 90% of CPU time was spent on graphics, 10% on gesture recognition and related computations. Overall CPU utilization was about 30%.
These 30% were noticeable: touch events were processed with delays and frame rate was low and not very stable.
In order to make app snappier, I moved the OpenGL rendering into separate serial dispatch queue. Now event loop was much less loaded, and I expected overall improvement. Not a higher framerate, but more stable one and with more accurate touch recognition.
In reality, the rendering was indeed slightly smoother, but touches were still delayed.
Profiler was showing now that 70% of CPU time was spent on graphics (in background thread) and 30% was spent on gesture recognition. Also, overall CPU usage increased up to 50%.
In terms of raw performance of algorithms nothing was changed at all. Threading code that was added is a simple dispatch_async() call consuming almost no time.
Now, I have a theory that explains this. Since the main event loop became 90% less loaded after moving graphics to background thread, it was able to process more touch events per second. Gesture recognition computations increased load on a single CPU core making graphics rendering slower than expected.
In result, framerate was not improved, but became more stable and touches didn’t get much smoother because of the increased pressure on CPU and main thread.
It turns out that rearranging stuff on a single core does not really help unless it is accompanied by actual performance improvements.
void(^OABlockConcat(void(^block1)(), void(^block2)()))()
{
block1 = [[block1 copy] autorelease];
block2 = [[block2 copy] autorelease];
if (!block1) return block2;
if (!block2) return block1;
void(^block3)() = ^{
block1();
block2();
};
return [[block3 copy] autorelease];
}
1. Download “Default Apps” Preference Pane: http://www.macupdate.com/app/mac/14618/rcdefaultapp
2. Select “URLs”
3. Select the URL schema. E.g. “github-mac”.
4. Change the app.

In May, 2010 I started experimenting with a UI for staging and committing to Git repository because it’s not easy to “git rm” a bunch of files that are already moved to trash (tab does not help). Also, I was tired of typing “gs” (“git status”) all the time just to see that everything is the way I want. Soon I realized I could make the app much more useful if I could integrate history cleanly without too much additional elements. I’ve spent a couple of days thinking about it and realized that the “stage” is a special case of a commit. I quickly came up with a two-pane window — history on the left and changes on the right. Stage was a special item in the top of the history. Since then a lot of good design decisions were coming quickly. Branches went to the drop-down menus in the toolbar with pull/push button between them.
Gitbox 0.9 looked very simple.
Quickly, everybody at our Pierlis office started using it. Staging, committing, pull, push became much more efficient than in Terminal or any other GUI starting with version 0.1. It was my first Mac app (I’ve already done some iOS projects for our customers), I loved it but still I was shy to release it. In June on WWDC10 my boss told me once more that “real artists ship” and I shipped Gitbox with version 0.9 for free. It looked clumsy and I really worried that nobody would like it.
But it was a success. A lot of people got interested by a concept of “one-button” Git client. Never before version control app, especially for Git, was expected to be “simple” or “minimalistic” yet useful. A lot of people dismissed it for a lack of features. But still many fell in love with it from day one and continued using it daily. For many it became the only way to work with Git repos without exploding their brains.
I got quite serious about it. I decided to polish it, add several more important features, streamline the UI (mostly by adding a sidebar for the repos) and released it in the end of November 2010 for $40 with a free version limited by 3 repositories (and no time limit).
It was a success again. Over a couple of days it made about $3000 which was totally unexpected as I was hoping for at least upgrading my notebook. Over months, it was steadily bringing some noticeable profit that helped paying for my wedding and honeymoon later in 2011.
I was amazed that something I designed, wrote, productized and marketed was actually appreciated by consumers. I even appreciate that keygens were released within a week after
each new version release.
I developed a long list of features and tweaks, rearchitectured the whole app several times (hello, responder chain and GCD!), was trying to keep focus and regularly deliver updates with both fixes, improvements and new wonderful features. It is still a “weekend” project, so I don’t have a lot of time to work on it. But what matters more is to keep going and improve it every day, at least a little bit.
Gitbox is still lacking some interesting things like built-in diff viewer, line-by-line staging, tree view or submodules. Those will come soon. But many more important things were already done: very responsive UI, instant full-history search (even by diff contents), undo for common operations like commit, pull and push (and more to be added in later updates), ubiquitous drag and drop and powerful keyboard shortcuts. Also, a lot of stuff was ignored that would cripple and complicate the UI. Some power features were delayed until the right place for them was found.
I consider Gitbox a right UI to do Git version control. The core design principles worked very well so far and allowed me to extend it to more and more new capabilities. UI is still, like in v1.0 very simple and clean, but is able to do so much more and will in the future.
Thank you all.

Some people would love to use proportional fonts for the programming code, but blame languages and text editing software for not being ready for them yet. The problem is that most proportional fonts (e.g. Helvetica, Lucida Grande) make punctuation characters too narrow making many statements hard to read.
Compare:
Monospaced font: if ([link isKindOfClass:[NSURL class]])
Proportional font: if ([link isKindOfClass:[NSURL class]])
Programming languages usually contain a lot of little syntactical features that are important to read and notice. One extra pair of parentheses or a semicolon may change the whole meaning of a line of code. And, unlike the real text, you cannot make a single typo.
If monospaced fonts look clunky, that’s because the programming languages normally require equal attention to every single character.
When you need to do CPU-heavy work, there is a nice pattern using GCD: jump to a background queue to do the work, and then back to caller’s queue to report the results. Do not forget to retain the caller’s queue because it may be deallocated while doing background work. Although compiler inserts retains for the ObjC objects referenced within blocks, queues are declared as opaque C structs (dispatch_queue_t), so they won’t be automatically retained.
dispatch_queue_t callerQueue = dispatch_get_current_queue();
dispatch_retain(callerQueue);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Do the work in the other thread...
// Example: NSArray* items = parseJSON(data);
dispatch_async(callerQueue, ^{
// Report results to the caller...
// Example: [self didParseItems:items];
dispatch_release(callerQueue);
});
});
Ruby is very similar to Objective-C because both have a lot of similarities with Smalltalk. However, Ruby is a messy language on many levels. Many consider it a mostly a feature, not a bug, but it indeed makes interoperability with Objective-C less nice.
1. Ruby has a messy syntax. It inherits several features from Perl, Bash, Python and C-like languages and mix them together without any clean distinction. You have always many ways to do the same thing and it is never obvious which one is the best. With Objective-C it is much easier to write a lot of boring and obvious code than with Ruby. Of course, this property appeals to coders who love funny things in their code, but it does not play well with people who want to ship huge complex applications and systems in time.
2. Ruby has a messy standard library. Many things in standard library are not well-thought, not consistent with other things, redundant or lacking essential functionality. Things like File vs. FileUtils, Date/Time/DateTime + ActiveSupport extensions demonstrate horrible inconsistencies at some core things.
3. Ruby has a messy culture. Ruby coders *love* smart tricks and hate boring code. Everybody wants to DRY all the code for better or worse or pretend being a cool meta-programming lisp hacker (not the best professional quality in itself). People are not careful about containing their libraries as humble as possible. Many people are okay to inject methods into core classes and do a lot of meta programming tricks and be proud of it. All this leads to maintenance issues and is not compatible with Objective C culture.
These three key things make Ruby incompatible with Objective-C or Cocoa framework.
It’s important to add that all of this is not unique for Ruby, but pretty much for any hobby technology, particularly backed up by some open source community.
Apple clearly puts a lot of effort into making LLVM infrastructure and Objective-C a powerful general-purpose toolkit for themselves. If they miss some feature, they are more likely to add it to LLVM and/or ObjC rather than spinning off additional separate projects. They already have WebKit and JS and that covers a lot of what they want to do. And they are bold enough and smart enough to improve things in both technologies whenever they want or need to.
Forget about MacRuby, MacPython and other languages in that respect, they are clearly are only interesting to people who focus more on typing codes than on shipping products.
I would love to have the following feature in Objective-C:
@property(retain, auto) id something;
Where “auto” attribute would mean:
1) automatic @synthesize (already present in modern Clang compiler)
2) “nonatomic” if not stated otherwise
3) automatic release (if “retain” or “copy” is used) and nullifying of instance variable on dealloc
Xcode 4 slowly replaces Xcode 3 for my projects. Benefits become more important than problems. So here is my list of things I like and dislike about Xcode 4:
Like:
1. Tabs
2. “Open Quickly” with fuzzy search by filename (cmd+shift+O), like cmd+T in Textmate.
3. Jump bar
4. Smarter autocompletion
Finally, the tabs and jump bar turned out to be the single reason to use Xcode 4 despite all of its annoyances. On a complex project window management consumes a lot of time.
Dislike:
1. The major problem with Xcode 4 is performance: switching between tabs, opening sidebars, autocompletion — all happen with noticeable delay even on iMac with i7 processor and 8 Gb of RAM. Bonus track for the latest Macbook Air: sometimes Xcode 4 eats 150-200% of CPU doing something (no matter whether debugger is launched or not). And when the debugger is connected to iOS Simulator fans just never stop. I hope this will be resolved with next updates.
2. No retina display mode yet in Interface Builder (but IB 4 is slow as hell, so I use IB 3 instead anyway).
3. Stupid (== “too smart”) assistant editor. When I choose another file manually, it is sometimes reset to some counterpart. And Open Quickly always opens in the left pane. Assistant editor has no value to me until these issues are fixed.
4. LLVM and LLDB. Turns out, the latest LLVM compiler has subtle bugs with nested blocks (sometimes self becomes an incorrect pointer) and LLDB does not display values for properties which were declared without corresponding ivars.
There are some things about Xcode 4 I don’t really care about:
1. Git support. I have a Gitbox anyway, which offers complete set of operations (committing from Xcode is a nightmare and pushing is simply not possible). Surprisingly, I’ve never used blame or in-editor diff. Those features sound useful, but in practice are rarely needed and feel sluggish.
2. IB drag-and-drop to source code to create actions and outlets. Xcode is slow and produces some awful code which needs cleanup anyway. Same thing goes for code snippets that take more time to find/drag/edit than to simply type the stuff.
3. iTunes-like status panel. I usually collapse the toolbar anyway, so I don’t see all those distracting animations.
When you develop some interesting software, you care to make architecture simple, boring and flexible as much as possible. When you think hard about user interaction or work around some weird system integration, the code should get out of the way . Whatever language you choose, you try to stick to some limited set of features and use them predictably and consistently. Ninja tricks are interesting on their own, but better not get mixed with an actual product.
As the complexity and amount of stuff to be designed and improved grows, you are becoming more conservative about any language or technology you use. All the sudden, discussions about C++ template complexities, braces styles etc. look completely strange and irrelevant.
Your code is so simple, you wonder why you should write it at all. Most of the typing is spent on defining objects, giving names and connecting things together. Every interesting algorithm is carefully packaged out of the evolving structure and is rarely touched again.
File system tree does not feel expressive enough. You need some sort of rectangles on the screen to lay out the components and hide some parts within the others for goodness sake.
You become even more productive if some of those rectangles provide immediate feedback, e.g. user interface elements in the Interface Builder.
The future of software development is not the language or syntax, but the interactive tools with instant feedback and sophisticated data organization.
Why are people so obsessed with the NFC buzzword?
The only safe and understandable way to conduct the payment with a phone is with the protocol like this:
1. Shop sends a payment request to your bank (via shop’s bank or directly)
2. You bank pings your phone and waits for confirmation.
3. You take your phone out and confirm the payment. You can do this securely over Wi-Fi, 3G, EDGE, Bluetooth, NFC and any other communication technology which lets you to speak TCP/IP and finally (after going through all the proxies and routers) connect to the Internet.
4. When bank gets the confirmation, it acknowledges the transaction and tells the shop about it.
5. Shop issues a ticket and you walk away.
This protocol is safe (contrary to modern credit card processing) because you never trust someone else’s device (you trust only your phone) and you never give away any secret information (like credit card number or a PIN code).
The only tricky thing here is how to give the shop your banking ID (which can be a phone number), so they can send it to your bank which will contact you for confirmation. This can be done in many different ways:
0. Tell the ID to the shop assistant - simple to understand, but needs remembering and typing in. Since we need a phone to confirm payment anyway, we don’t even count it.
1. Show the barcode on the phone’s screen and scan it. You need to launch a payment app anyway. Why not to display you bank ID as a barcode on the first screen so you can simply scan it.
2. Use NFC to announce your ID to the shop. This like barcode scanning, but without optical scanning. It has its issues, though. If you have many devices nearby, the receiver may confuse your device with someone else’s, or recognize your slower. Everybody knows how slow bluetooth is.
3. Do it in reverse with NFC: the shop will publish you bill and (if you are lucky) only your phone will see it, so you can send it to your bank.
To me, the most usable ways to conduct payments are #1 and #2. And #1 seems to be simpler and faster (but feels “lo-tech”).
Bottom line is: NFC is not a requirement for payments with a phone. You need any communications tech to connect to your bank and can use different ways to announce your banking ID.
I also hope, that the phone payments won’t be done in the same way as credit card processing is done. That is, by giving away secret codes and trusting the shop to confirm the transaction.
Gitbox started selling in November using old-school method: download a free version from gitboxapp.com, then upgrade to a paid version by buying a license.
Today Gitbox is available on Mac App Store as well. What this means to you?
If you have already purchased Gitbox, you don’t need to “connect” it to App Store. First, it is impossible to do for free: you’ll have to buy it again, from Apple. Second, you won’t miss much. Gitbox is a single-version application: there is no “lite”, “full”, “appstore” or “non-appstore” variant. The functionality is all the same. (Only difference is that binary in appstore has different autoupdating and license checking mechanisms.) Gitbox already provides automatic updates for free. There is one nice feature of the non-appstore purchase: updates can be released within minutes instead of a week.
Note that App Store marks the app as “installed” if it sees it on disk even if it was never downloaded from Apple. If you want to purchase it from Apple (maybe you have not yet purchased a license), then you should drop the app to Trash and restart App Store: the purchase button will become available. Your preferences won’t be affected.
So how do you decide where to purchase an app? Both distribution channels are great: appstore is more controlled, but sometimes much more convenient, another one is more flexible, but less integrated into OS. I believe it is important to keep both options available to you, but I want to avoid any confusion. So here is my policy:
1. Prices and discounts will always be the same and synchronized for both stores. The app is the same, hence the price is the same.
2. I will do my best to release big updates synchronously on both stores. I usually don’t release more often than once a week or two, so it is very possible to adjust to the appstore review delays.
3. In case of security updates or critical bug fixes, I will post an update immediately even if the appstore does not publish it as quick as I do on my website.
Enjoy Gitbox and buy it where you like. You will get the same support and love everywhere.
How do you add a view (spinner, text field, button etc.) into the cells of NSTableView or NSOutlineView?
Simple:
1. Keep a reference to the view in your NSCell.
2. In drawInteriorWithFrame:inView: you should create the view if needed and add to the controlView if needed. controlView is provided as a second argument to this method.
3. Position the view according to the cellFrame (first argument to the drawing method).
4. Do not forget to retain or nullify the view in copyWithZone method. Remember that copy and copyWithZone copy instance variables as-is without retaining object pointers when you might need that.
Correction on January 6th, 2011:
There is no point in keeping a reference to a view in the cell. After the cell is drawn it is often deallocated immediately, so the view will stay visible forever. You need to keep the reference to the view in some external non-volatile object: a view, a view controller, or a model.
I’m happy to announce that Gitbox reached its first major milestone: a first commercial release. It is a great version control app for working with Git repositories. Instead of cutting down the powerful, but complicated concepts of Git, Gitbox embraces them with a truly elegant user interface. Many people start actually using branches in Git thanks to Gitbox.
Download Gitbox 1.0 now. Use coupon GITBOXNOV before December 1st to get 30% discount.
Since the last preview version, a lot of things have changed. I have worked out a strong vision of what kind of product I want to create. As a part of it, I have redesigned the user interface and reengineered the underpinnings. Now all the repositories live inside a single window and the app itself is running on Grand Central Dispatch (GCD) on Snow Leopard. Translation: Gitbox is faster and easier to use.
A couple of thoughts on licensing policy: usually commercial software comes in two flavors: a full and a trial. Here’s the problem: when I download a trial version it is usually limited to 14-30 days of free use. I may try the software for a couple of minutes, then put it aside and forget about it until I have a real need in it (or some very handy feature is released). When I come back to the newer version, it appears I cannot try it any longer!
Gitbox does not do that. You may try it right now and for as long as you want. You also have all the features available with only one fair limitation: only one repository opened at a time. Why is it fair? Because if you don’t find Gitbox useful enough to pack it with all your repositories and use it every day, I don’t want your money. Instead, I would be happy to listen to you and make it better.
When you do buy a license, you get more than you paid for. First, all updates are free (some really cool features are coming soon). Second, you may use the app on all your machines without any sorts of spyware, activation etc. The only limitation is that the license is for personal use. If you want to buy Gitbox for a group, you should buy an appropriate number of individual licenses. Contact me if you’d like to get a discount in that case.
I will release new features and incremental design improvements regularly in a form of free software updates. As the app becomes more powerful and better designed, the price is likely to rise. Since the updates are free, this idea should convince you to buy a license early at a lower price ;-)
I’m very thankful to my family, colleagues at Pierlis and all the folks who were using preview versions and giving a lot of priceless feedback.
Let’s get it started.
In a software business, the functionality is an asset, but code is a liability. The less code needs your attention, less costs and risks you have.
OOP is all about making stuff work, packaging it into an object with as small interface as possible, and building other stuff around without going back and tinkering with that package. Note to Java people: it does _not_ mean the object should fit everything. It should fit at least a single task and be reliable at that task. The point is in reliability, not reusability.
This concept is called “incapsulation”. It is not the way to make the code nice. It is the way to minimize your costs and risks and finally ship.