How I Built a Bitcoin Exchange: Design Principles & Risk Management

In 2013, I designed and built a cryptocurrency exchange for the China market.  The basic concept & architecture only took a few days, but the full implementation required several years.   I shared the basic architecture in 2013, and with the recent spike in interest in Bitcoin and Ethereum, I thought I would share additional details on the concept.

I wrote the trading engine for the exchange over a long weekend in Shanghai.  It turns out that building a large-scale cryptocurrency exchange is quite complex, and it finally (and successfully) launched in 2016.  The notes below describe my design vision from 2013 – the implementation followed this specification fairly closely.  There is a lot of detail and documentation to many of the sections below – some of which I will elaborate in future posts.  If you want more detail on something specific, comment below or find me on LinkedIn.

Happy 10th birthday to Bitcoin!

Happy birthday to Bitcoin! 10 years ago, Satoshi Nakamoto published a white paper for “a Peer-to-Peer Electronic Cash System” which would “allow online payments to be sent directly from one party to another without going through a financial institution.” Just a few short months later, the Bitcoin network launched on 3 January 2009.

Bitcoin is the culmination of thousands of years in the evolution in money. It is durable, portable, divisible, uniform, and limited by design. Over the span of human history, money has taken the form of shells, salt, coins, banknotes, and fiat bills. While money serves a crucial role in facilitating trade and wealth creation in society, it has often suffered from hidden inflation, outright confiscation, or the exclusion of unpopular groups from the economy. In the 100 years, the inherent flaws in fiat paper money have been used by governments to fund wars, corruption, and cronyism through the hidden tax of inflation.

Bitcoin is the first credible alternative to fiat currency and offers real, sound money made for the information age. The decentralized nature of Bitcoin has revolutionary potential for both the global economic order and billions of people who suffer from lack of access to financial institutions and corrupt governments and corporations. The concept of a distributed ledger stored on the blockchain has applications well beyond money, with the promise of creating a durable and credible record of property ownership, which has the potential to transform how we record property deeds, corporate shares, insurance claims, business contracts, and many more applications.

After the basic concepts of Bitcoin and the blockchain were discovered in 2009-2013, Bitcoin and the blockchain space entered the infrastructure stage. We are now building the ecosystem of tools, vendors, and relationships to make Bitcoin as easy or easier to use than products of legacy financial institutions. Once a mature infrastructure is in place for cryptocurrencies, the stage will be set mass adoption. Billions of people will have the devices, services, and vendor networks to use Bitcoin for everyday transactions, meeting the final requirement for money: widespread acceptability.

The mass adoption of cryptocurrencies will not create a utopia – it is more likely to be hugely disruptive to the economic-political order. However, genuine sound money is what humanity desperately needs to build a harmonious, robust, and integrated global digital economy on the backbone of the Internet.

Is your “side hustle”​ holding back or advancing your career?

I encourage people to develop a “side hustle,” but they are not suitable for everyone, and many people get hustles that do more harm than good.

The proper function of a side hustle is not to earn a few extra dollars — it’s to grow your value proposition and train for a life of financial independence and entrepreneurship.

Many people get a side hustle that distracts rather than enhances their career. Driving Uber at night or hosting Airbnb guests every night is not going to enhance your career unless your dream is to be a chauffeur or enter the hospitality industry. Same with being a jack-of-all-trades who takes whatever job he comes across.

Is your side hustle causing you to sleepwalk through the workday or work on your gigs from the office? Are you spending more money on tools and supplies for each new gig that you bring in? Are you growing as a professional and building a sustainable, revenue stream with customers that come back to you, or are you doing random, one-off jobs, often for free? Are you giving up new projects at work, a promotion or a demanding new job for your side hustle? If so, it’s holding you back rather than helping you. You don’t need more spending money: you need to create opportunities for you to grow.

A good side hustle should help you to grow in your career or to explore a new one. You should come to the office excited to try out new ideas, not just tired from staying up all night working in an unrelated field. And if your idea is so great that you can’t perform your day job, don’t try to do both: quit and pursue it full time. You’ve saved up your reserve fund already, right?

How to make the most of the 2018 Google Ad Grants rule changes

ad-ban

Does that big red message look familiar? If your non-profit received a Google Ads Grant (if not, apply here), you may have noticed a major change in Google Ad Grants policy in 2018. Here is a summary of the new rules from Google, and here is a more comprehensive writeup. (Note: Neither list is perfectly accurate as these rules are not 100% enforced.) The bottom line with the 2018 rule changes is that you must have relevant, narrowly-targeted, high-performing ads with conversion tracking and relevant landing pages or your Google Grant account will be suspended. That’s the bad news. The good news is that Google removed the $2 bid limit, so you can bid more per click and compete for keywords that were previously off-limits. Below are some points for what I’ve learned for surviving and thriving with the new Google Ad Grant policy: The main success criteria for an Ad Grants account are:

  • High click-through rate – low (< 5%) CTR is the main reason accounts get suspended. If your account does not maintain a 5% rate for two months, you will get suspended. Loophole: AdWords Express accounts are exempt from this rule.
  • Low landing page bounce rate – visitors immediately navigating away from the ad page is another reason accounts get suspended.
  • A high percentage (75% is my goal) used of the monthly Grant budget.
  • Conversion tracking: clicks are a start, but you should also be tracking on-site conversions (i.e. leads and purchases). This is not just valuable to measure the effectiveness of your campaigns, but is now required by Google.

In the process of managing FEE’s $40,000/month account, we were suspended three times, and learned a lot about the new rules in the process. It is possible to maximize your spend, but the game is a lot harder, and you will have to put a lot more thought into the process. There are three strategies for being successful with a Grants account:

  1. Well defined audiences: this includes both narrowly targeted search keywords, demographic filters, and retarding (if possible)
  2. Relevant landing pages: landing pages should be specific to the search phrase and have enough information and call to action so that user can complete their search
  3. Enough campaigns targeting high-volume keywords with > 5% CTR to maximize the Grants budget. For example: with an average cost of $2/click, hitting 100% of a $10,000 budget requires 5,000 clicks*5%CTR = 100,000 searches, or 50 ad sets with 2,000 searches each. These are hypothetical numbers, but 50 campaigns targeting 100K searches seems like a reasonable target to hit a $10K budget. Here is FEE for comparison: about 40 campaigns, 272,000 searches, 22,563 clicks, $28,000/month current spend. That is: 8.3% CTR, $1.23 per click, 1092 leads generated, or $25 per lead.

The three key build-out steps you should take to implement to an effective Grants campaign are:

  1. Build customer personas: work with your team to build profiles of the demographics and interests, and potential search phrases
  2. Research search phrases: use the Google Keyword Planner, Moz Pro and other tools to find the intersection of
  3. high-volume search phrases
  4. suitable landing pages on your site
  5. low keyword difficulty
  6. Build out Ad campaigns: using the keywords and landing pages previous identified, build out

The following practices will be needed on an ongoing monthly basis: Review campaign performance, stop low-performing campaigns (important to prevent Grants account suspensions) and replace them with new ones. Campaigns may also experience fatigue for some phrases and require rotation.

  1. Research and recommend new landing pages to take advantage of target keywords
  2. Implement business goal tracking to optimize for lead generation and bounce rate/session duration in addition to click-through rates
  3. Review and implement with Google Ads feedback (Google provides ongoing feedback and optimization suggestions) and resolve account suspensions.

Finally: landing page considerations:You must have relevant landing pages with clear mission-specific, non-commercial content. One way I did this is by creating “essential guides” for the topics in various campaigns. Another strategy which works great for both organic and paid traffic is to compile pillar pages. Do not expect to be successful by sending all your paid clicks to your homepage. Google states that “your homepage and frequently visited web pages may not be used for Destination goal types” Requesting reactivation: Is your account suspended? Once you’ve complied with all rules above, request reactivation here.

If it’s not on your calendar, it’s not in your heart

When you have an important business meeting coming up, you put it on your calendar, right?

Why? Because putting things on your calendar prevents double-booked or forgotten plans.

What about your family? Are commitments made to your partner or kids less important than to your coworkers?

What about your commitments to yourself – your health, your education, your career development, etc.

Are you sabotaging your personal life because you subconsciously value your family — or yourself — as not deserving of the same commitment and undivided focus as you do your job?

If it’s worth doing, it’s worth doing well, which means making and keeping commitments.

If it’s not on your calendar, it’s not in your heart.

Why I prefer to live in a small apartment with a family of four

People are shocked when I tell them that prefer living in a one-bedroom, furniture-free apartment with my wife and two kids, even though I can pay cash for a McMansion or two in the ‘burbs. Why do most people need more space? 

Consider my closet: 
When I decide what to wear to work in the morning, every shirt in my closet is a good option. I’ve gotten rid of anything that for whatever reason is not a viable choice. Most people have filled the majority of their closets with clothes that don’t fit, aren’t stylish, too old, etc. My shirts are dividend into dress, casual, and workout shirts, and I can choose any shirt from each section without a second thought. 

By only keeping possessions that continue to add value to my life, I eliminate the physical, financial, and mental drag that comes along with keeping useless possessions. I apply this principle to every aspect of my life:

  • Toys: The toys that many parents choose for their kids reflect a fear of real life. Their toys represent, a safe, “nerfed” plastic version of adult responsibilities. Kids don’t need fake plastic houses, power tools, cooking appliances, cars, or phones because they don’t need to fake adult responsibilities: they can assume them one at a time. Our daughter got her first sharp knife and her kid-sized broom at three and helps out cleaning, preparing her lunch every day, makes her bed, etc.  She acquires adult tools and responsibilities as she becomes physically and mentally able. When she becomes an adult, she will have been doing adult responsibilities and using adult tools for decades. 
    Note: I’m not against toys, just toys which are “nerfed” versions of work that kids are capable of, or providing a plethora toys in an effort to isolate kids in a “play universe” which distracts them from assuming real responsibilities.  For example: A doll or construction blocks are productive toys, fake plastic eating utensils are generally not.
  • Professional projects: Is this project a success story I want to tell about my career? Does this contribute to the goals I set for this quarter?
    My digital data: I fit my life on a single SSD by using visualization and de-duplication tools to see the entire of my digital life and delete what I no longer need.
  • Relationships: Do you add value to my life now? If not, why am I spending my time on you?
  • Furniture: We only keep furniture that improves our lives. Some of our furniture, like our floor-seating dining time, is custom-made to fit our needs. We have no chairs or couch in our home because we decided that our health would be better if we let our bodies do the job of holding us up.
  • Finances: I can tell you how much assets or debt I have in each account, and how all of my investments are distributed. I avoid unnecessary financial commitments, combine/rollover my investments, and use a single app to visualize my entire financial life over my lifetime.
  • Daily time: I jealously guard the commitment and habits I make each day. I use five tools to visualize my the locations I visit, the software I use, and the websites I visit.
  • Television: I don’t watch TV (though I spend too much time on YouTube), but if you do, track and re-evaluate whether you can be doing something more valuable or rewarding with the time you spent on specific shows.
  • Social media use: I use HabitLab and Apple’s ScreenTime to set limits on how much time I spend on social media sites/apps.
    Old hobbies: most people have a bunch of junk from abandoned hobbies in their closets. Sell it and focus on what you do now.
    Books: I sold or gave away all my books and put everything on my Kindle when we moved to China. I have never thought “I wished I kept that book.” Unfortunately, I keep getting new free books – what can I do with used books in Atlanta?
  • Emotions: We carry emotional baggage in the associations between places, people and situations, and the ingrained emotional reactions they have developed habits around. Separate your rational-evaluative self from your reactive-habitual self and consider whether your emotional responses are productive for the situation you are in.
  • Insecurities: Over a lifetime, we accumulate fears and insecurities about problems we used to face and inadequacies we used to hold about ourselves. Focus on the person you are becoming, not who you were in the past.

And that’s why a small apartment works for us. An extra room (at this time) would only add unwanted and unnecessary costs and obligations: the cost of higher rent, the cost to clean it, and especially the daily mental overhead of keeping the room neat and organized, etc. To keep up with an entire house is an enormous responsibility. To whatever extent is possible to me, I want to limit every aspect of my life to the things that continue to give me value and lead me to become the person I want to be – not things that reflect who I was in the past.

How to apply evolutionary biology to extend your lifespan

Here is the actual reason we grow old and die. Are you ready? It’s brutal:

Let’s say there is a 2% chance that any given primitive human will die from external events each year. He might get eaten by a bear, starve to death, have a bad fall and get left behind by his tribe, get clubbed in the head, lost in the woods, etc. We can get the probability of not having been killed by an external event as (chance of being alive)^(age)
For example, at age 10 that is .98^10=81%, age 30 is 54%, 70 is 24%, 100=13%.

For any given unit of energy and nutrition, the genome can either invest in current reproductive potential or preserving the body for future reproductive potential.
For a 10-year-old, his reproductive potential is in the future so the body will invest most resources in self-maintenance.
For a 30 year old, the genome will balance the energy directed to self-maintenance and for preservation for future reproduction.
Since most humans will die by 70 due to an external event, the self-preservation mechanisms will not optimize for either.
The genome just doesn’t “care” at this point, since most of the hosts carrying its instructions are already dead. That’s when (and why) the body begins to rapidly fall apart.

One key mechanism for this process is in the cellular tumor antigen p53, mutations of which cause the majority of cancers in humans. There is a tradeoff between anti-cancer mechanisms and energy expenditure since cell-malfunction detection uses energy. Species which obtain an evolutionary benefit from long lives have much better cancer-prevention mechanisms. That’s why the naked mole rat (which lives in underground colonies) is resistant to all forms of cancer and can live for many decades while mice (which are food for many predators) live for two years.

So, the reason that we die from old age is that your genome expects you to be dead from an external cause after a few decades and does not care about keeping you alive.

Applying this logic, here are some ideas for living longer by manipulating your genes:
We can’t change our genome, but we can influence gene expression by manipulating environmental inputs. As previously stated, if your genes think that your reproductive years are in the future, they will allocate more resources to self-maintenance than reproduction.
The simplest way for men to do that is with castration: a study of Korean eunuchs showed them to live 14.4- to 19.1-years longer than the lifespan of non-castrated men of comparable social standing.
For women, studies show that the later a woman gets her first period, the older she will be when she goes into menopause and the longer she is likely to live. “Early” puberty in girls is caused mainly by excess calorie consumption and is linked to obesity. Furthermore, women stop having periods when their calorie budget does not support a pregnancy – this sends a signal to preserve resources for the future.
Doing this voluntarily is known as a calorie-restriction diet. Calorie restriction in ants, mice, fish, flies, worms, and yeast has been proven to dramatically boost their lifespan, and there is now a well-supported body of evidence that periodic fasting and low-calorie diet has anti-aging properties in humans. It works for males and females, perhaps because genes want to preserve the body for the future, and because the genes of starving men assume that the women in their tribe must also be starving.
An easier strategy of signaling to your genes that your reproductive potential is in the future is to adopt youthful behaviors. The body does not have an odometer, so the genome must rely on proxies for age, and by acting like youths, we might trigger age protective factors in the genome. Common behaviors of primitive children might be: plenty of sleep, physical play, taking care of small children, lack of stress, and learning new skills.
Read more:
Richard Dawkins’ “The Selfish Gene” (for speculation on signaling youthful behavior)

What if we paid for restaurants like we pay for school?

Sending my daughter a Montessori school costs about $15,000 per year. We have two daughters and plan a third child so we may be paying $45,000 per year for some time to send three kids to private school. The cost is worth it because I do not believe that public schools are capable of preparing children for success in life. My own experience as an honors student in a “quality” public school made me hate learning, failed to prepare me for college, and was a miserable social experience.

I don’t mind paying for my children’s education. What I mind is that I still have to pay for government schools that my children will never use.

Imagine if we applied this reasoning to food:

“People must eat to live, so we will force everyone to pay for Golden Corral buffets.
If you don’t like Golden Corral, you can eat somewhere else. You still have to pay for everyone else to eat Golden Corral though because Food is a Right.
If people could choose which restaurant they want to pay, Golden Corral might not have enough money to keep its buffet stocked, and people would go hungry.
Anyway, since you can afford to pay for Golden Corral *and* Five Guys, you must be rich, so paying for your and other kids meals must not be a problem for you. Also, Five Guys must take a portion of what you pay them and send it to Golden Corral, via property taxes on their building.

By the way, you can try to make food at home, but if Golden Corral’s Food Inspector does not like it, he will abduct your family and force feed them Golden Corral. After all, Everyone Must Eat.”

Is Bitcoin a help or a hindrance to criminals?

Reposted from my Quora answer:

The way this question is phrased is problematic.

Are pencils useful to criminals? They can be used to write down schemes for robbing banks, kidnapping letters, etc.

What about guns? Weapons give criminals an edge in committing crimes.

Of course, pencils and guns can be used against criminals as well. Most people would agree that it’s a good idea that weapons exist (even if you think that only the policy and military should have them) — otherwise, the strongest bullies could force their will on everyone else, and society would collapse.

So what you should really ask is – will Bitcoin lead to more crime or less?

Arguments for more crime:

  • The quasi-anonymous nature of Bitcoin makes it very convenient for extortion payments, bribes, etc.
  • Stealing Bitcoin can be easier than stealing cash given that it is portable, easy to transfer, the transactions are irreversible, etc.

Arguments for less crime:

How many cryptocurrencies will survive the infancy period?

Reposted from Quora:

The best way to estimate how many cryptocurrencies will survive the infancy period is to look at other markets.

For example, how many social networks survived the infancy period?

Facebook has 63% market share:

If you use a stricter definition of “social network” to mean “feed-based platforms based around personal profiles” Facebook has over 99.8% market share. Google+ and Diaspora are well under 1%.

What about Search Engines? Google has 87% market share.

What about Desktop Operating Systems? Windows has 82%.

What emerges from looking at these and other markets is that network effects lead to a dominant player, a secondary minor player, and about three competitors with marginal market share.

However, if you expand the definition of the market, the picture can change dramatically. For example, if you include mobile device in the “operating systems” market, Android is #1 at 41. Likewise, Facebook’s dominance varies from 60% to 99.8% based on how strictly you define “social network.”

Let’s apply these insights to cryptocurrencies:

A single dominant cryptocurrency is likely to emerge with 90%+ market share. Given the strong network effect of money and the probable lack of nation-state restrictions on adoption (unlike the USD), the dominance may be over 99%.

However, if we expand the market definition to “cryptographic assets” or “digital assets” then we need to include tokens and securities such as Ethereum and ERC20 tokens. This expanded definition may see the leader’s share drop to 60–70%.