Blockchain for Business and Product – Part 2: Mining Cryptocurrency

(Part 1: Mental Models for Blockchain)

There is currently a lot of hype around cryptocurrencies, blockchain technology, and decentralized consensus systems. There is also a great deal of confusion around why the hype exists, what the unique value of these systems is, and how one might jump into this ecosystem to try their hand at building something. This, in general, makes it difficult for industry professionals to separate signal from noise.

This blog series is aimed at describing some of the core businesses and products that have arisen in the tech industry given the recent advances in decentralized consensus mechanisms, so that individuals focused on building new products and businesses can see the landscape quickly, get their hands dirty, and build something new.

This second article will walk through the system design for one business in this space – cryptocurrency mining. We will discuss what it is, how it fits into the ecosystem, and how the business works.

Mining for cryptocurrency is renting your compute power to a bank and getting paid for this service. Understand the profit and loss of this business and how to iterate to improve return on investment.

Align your interactions with blockchain and crypto to your values. Mining a cryptocurrency is supporting that economic system and its banking operations, by using your computer systems to be the labor for the banking administrative tasks. Mining many coins is supporting many economic systems and potentially their interactions and dynamics.

This is similar to using your car to support the transportation system and business operations of companies like Lyft or Uber. For instance, with Lyft you use your car as the hardware, spend money for gas, pay for mechanic fees from upkeep, and invest your time to drive instead of other activities. The profit at the end of the day is how much money you made during the day minus all these costs of using your vehicle for this ride-sharing service. Is it viable?

Mining cryptocurrency is like installing a solar panel and selling to the grid. The main objective is to turn electricity into money.

Mining cryptocurrency is also similar to installing a large solar panel array on your house and earning money by selling electricity back to the grid. In this example, you have to buy the array and batteries, pay for installation, and keep the system working. The output at the end of the day is how much money you made from the electricity sale minus the upkeep. Is it viable?

In the same way, when you are mining for crypto, you are using your computer in a “banking-operation-system”-sharing economy. Is it viable to lend your computer in this way?

The high-level overview of a mining business. The main objective is to turn electricity into money.

 

For the following example, I’ll focus on Monero, a specific cryptocurrency that has a mission and economic system that many people value. Monero is a cryptocurrency that has private accounts, robust security against bad actors, a mining system that is more accessible for people wanting to contribute, and many other advantageous features. For more information on Monero, check out this book.

The cost to running this Monero mining business includes:

  • The original cost of your mining hardware
  • Electricity costs, based on your local electricity rates, which are typically measured in kWh/mo
  • Mining pool fees. Even though mining by yourself is possible and accessible to more people in Monero, mining as part of a collective creates more stable revenue. Being a part of this collective, however, incurs a small fee to the pool operator.
  • (If desired) Conversion fees between your mined currency (here, Monero) and a larger cryptocurrency (e.g. Bitcoin)
  • (If desired) Conversion fees between a larger cryptocurrency and USD

Additional pieces you need to support this business:

  • Wallets/accounts for different currencies and for currency exchanges
  • The software for mining
  • Knowledge about how to transfer funds to different accounts

Note: People can hold their assets in many ways. USD, Yen, Euros, real estate, jewelry, art, equity in a company, life insurance contracts, Bitcoin, Monero, etc. For most readers, I’m assuming they keep most of their assets in USD, so I’m also including parts of the business that turn Monero into USD.

Conclusion

Using your computer as an asset in a blockchain-oriented system is just like leveraging your car and time as a driver for Lyft, or a solar panel system for selling electricity to the grid. How is your computer being used? How is it providing value to you? How much does it cost to let your system be used for this? Is it worth it to you?

Setting up a business mining a cryptocurrency (in this example, Monero) requires you to think through how you would create, own, and operate a business. What are the system components? How much do they cost? What are the operations and how does the system run? If the business is not profitable, are there ways you can optimize parts of your business to make it run better and head toward profitability?

I encourage everyone to think through all of these avenues to understand how business in this new era will operate, which ones you should be a part of, and how you can continually make them and yourselves better in the process.

 

(this post was originally hosted on Medium)

Blockchain for Business and Product – Part 2: Mining Cryptocurrency

Blockchain for Business and Product – Part 1: Mental Model

There is currently a lot of hype around cryptocurrencies, blockchain technology, and decentralized consensus systems. There is also a great deal of confusion around why the hype exists, what the unique value of these systems is, and how one might jump into this ecosystem to try their hand at building something. This, in general, makes it difficult for industry professionals to separate signal from noise.

This blog series is aimed at describing some of the core businesses and products that have arisen in the tech industry, given the recent advances in decentralized consensus mechanisms, so that individuals focused on building new products and businesses can see the landscape quickly, get their hands dirty, and build something new.

This first article will establish some baseline metaphors for the current blockchain ecosystem. The second article will walk through the system design for one business in this space — cryptocurrency mining.

A blockchain is like a component of a business, but decentralized. Right now, people are focused on building components for banks and financial systems.

Banks are a particular type of business and product that provide many features to their users. For example, as a user of a bank, you can store your money in a place that’s more stable than under your mattress, as well as send and receive money with other people without mailing it. In order to make the latter feature work, banks must perform a series of administrative tasks that assure the money transfer has been completed correctly. Fixing errors in this process, removing inefficiencies in the administrative tasks, or changing how this business component fundamentally operates are several ways to make everything better and improve this feature of the bank for its users.

Cryptocurrency mining, at its core, focuses on improving fault tolerance and removing security risks in a bank’s money transfer system. Instead of having a centralized record system at the bank, where every employee doing administrative tasks is modifying the same centralized record system, imagine there is a room full of people doing their own administrative tasks on their own separate record systems. These people also sync with each other and share the results of their work, so that they all know the transactions that are happening and can keep each other accountable. This sharing is also public, so customers can hold the bank accountable. If one record system fails, there is still a room full of other systems working and keeping it running. If a bad actor tries to falsify the records of one person, it’s easily detected because everyone else can share the record systems and detect the anomaly.

These changes in the way the business component works makes the product better and delights users more, but they are mostly invisible to bank users. If users go to the bank and send money, they are mostly focused on the process being correct and fast. If it happens to be fault tolerant and more secure, that probably matters as well, but how those aspects are achieved operationally is less important — these things matter to those inside the business.

The reason cryptocurrency users, as bank users, are also so focused on these banking mechanisms is that they also want banks to be completely decentralized. So, they are building systems for two core users — themselves as bank patrons that want to use good financial systems, and themselves as the bank itself that wants their systems to be run by a community. But the systems being built can be effective as improvements to banks just as much as creating and improving a fully decentralized bank.

Supporting a specific cryptocurrency is supporting a specific type of economy. Support using your values.

Banks allow you to perform many actions with your money, like transferring it to others, but these operations are always performed within a specific currency. Even if there are multiple currencies involved, you are leveraging systems that do the work of transferring between currencies.

Holding onto specific currencies is an implicit statement that you think the currency of the associated economic system is strong, and that you believe the mechanisms of those economies will be more robust and successful. Every currency is associated with a country or set of countries, so you are also implicitly aligned with how that country runs itself and its monetary systems. For example, if you hold US dollars (USD), then you believe that America’s economy will keep growing, that the taxation system is acceptable, that the amount of supply and trading rates are acceptable, the way they control inflation and new currency generation is acceptable, and many other economic factors.

Cryptocurrencies all have different economic systems (mostly separate from countries, although some are tied to central banks), and putting your assets in them is an implicit assumption that their economic system is better and will grow long term. Just like real currencies within government economic systems, cryptocurrencies differ in their economic structure. These differences can include the privacy of asset holders and their account values, governance of the economic system, how the mining system works (how their banking tasks work), how secure their system is against bad actors, how money flow is regulated, how regularly new currency is added to the supply, and much more.

For example, Monero is a specific cryptocurrency that has a mission and economic system that many people value. Monero is a cryptocurrency that has private accounts, robust security against bad actors, a mining system that is more accessible for people wanting to contribute, and many other advantageous features. For more information on Monero, check out this book.

Conclusion

Leveraging blockchain technology, in many cases, is just reorienting your mindset on how your data and assets are handled — are they centralized or decentralized? How does the data synchronize between these systems? Is the system you built actually tolerant to people disrupting the network connections?

Supporting specific blockchain technologies or cryptocurrencies often involves understanding the economic dynamics and what properties those systems value. Which ones line up with your world view?

I encourage everyone to think through all of these avenues to understand how business in this new era will operate, which ones you should be a part of, and how you can continually make them, and yourselves, better in the process.

Blockchain for Business and Product – Part 1: Mental Model

Build Products for People

Design for User Journeys through life, not just software

Building Products are about finding pathways and solutions for people to achieve something meaningful.

I find the most compelling products are those that build solutions for people to achieve something meaningful in life. Users exist in a current state of being, desire to be in a different state, and face problems in achieving this. Products are solutions to making this transition successful, and then if part of that solution is a piece of software, there is a user journey through that software component of the solution. Essentially, you are encapsulating your personal ability to help someone transition through life, then automating and scaling what you know is successful.

Product Example: Opendoor

An example of a compelling product like this is Opendoor, which focuses on helping people that want to go from owning a house to having it be sold fairly and moving on with their life. The solution Opendoor has created for their users encapsulates and automates the role of a real estate agent (and many of the other services) that are required for the user to go from one state to the next, and provides this as an incredibly fast transition.

Product Example: Insight Artificial Intelligence Program

Another example product is Insight, and the AI program which focuses on helping Software Engineers and Researchers go from their current role to a new cutting edge career that leverages machine learning engineering. These individuals exist in a current state, desire to be in a different state, and face obstacles to being successful. The aim is then to provide education and mentorship to these people to make a successful role or life transition. The solution for this is to provide ways for these people to work on real company data, use appropriate machine learning techniques, and build models or tools that have value for a company or business.

Modeling Humans for Product Design

I tend to mentally model these scenarios, and finding solutions to them, in the same way that I would approach modeling artificial agents (similar to POMDPs, but with my own modifications).

Such a system looks like the following:

  • States: There are many possible states of the world. Which ones are your users in and which ones do they want to be in? The state users are in also constrains what inputs and outputs are actually possible.
  • Sensory input: Given the state of the world, what aspects of the world do they have access to?
  • Input perception: Given the informational input they have, what is their perception of it? e.g. what tinted glasses do they wear when they see the world?
  • Output perception: What internal understanding do they have on what actions they can perform in the world?
  • Motor output: What actions do they actually have available in the world given the state it is in?
  • Motivation/Reward: Given the state of the world, which also constrains inputs and outputs, AND the perception of both of these, how rewarding do they find this vs other states?
  • Strategy/Policy: Based on what they care about, what they know they can do and what they sense about the world, what’s the way in which they actually interact with the world to seek reward? This process could be active (the agent interacting with the world is aware of their own policy) or passive (they interact with the world but are unaware of their policy, although others could reverse engineer it from their observations)

Using Framework to design products for people

Translating this computational agent-based view into a system for analyzing and creating solutions for people moving within the real world then takes the following form below. I’ve also indicated some potential solutions for how to add value when solving this problem, highlighting where data, sales, and marketing come into play.

  • States: What real world scenarios exist for our users? Solution(s): Make more potential states of the world which changes the game being played.
  • Sensory input: What information do our users have access to? Solution(s): Provide more access to information. Create new sources of input that didn’t exist before. Build systems to aggregate data and give access.
  • Input perception: How do our users interpret all of the information they have, or how do they interpret the data when it’s completely messy and mostly patternless? Solution(s): Help users reinterpret the data they do get. Change sales and marketing, provide data stories to augment how users interpret the available data.
  • Output perception: How do users interpret what they can do in the world to move around in it? Solution(s): Help users reinterpret what they can do in the world and don’t realize it, or provide information/situations where they can gain this capacity. Provide documentation and guides for doing things. Provide additional sales and marketing to inform users. Provide data and stories and use cases to make potential actions visible.
  • Motor output: What can they actually do to act on the world? Solution(s): Provide more access to all systems that currently exist. Create new ways of taking action that didn’t exist before. Create systems that can automate the actions you want to take.
  • Motivation/Reward: What do they actually care about? Solution(s): Provide ways for people to understand what they value or influence them to value certain things. Increase marketing to show what’s desirable. Provide more data to people about what others value. Show data on what is actually more valuable based on certain frameworks, e.g. financial benefits.
  • Strategy/Policy: How are they going about their interaction with the world? What is their actual method they are doing now? Are they aware of it? Solution(s): Make transparent the ways people are interacting in the world and what other potential ways exist. Provide ways for people to understand their sensations, perceptions, actions, and motivations to see what are better ways of doing what they are trying to do.

Applying this to Opendoor

  • States: What real world scenarios exist for our users? e.g. people can own or not own houses and can move between these states.
  • Sensory input: What information do they have access to? e.g. people might only see the property values around them or have access to some of this information online. Or they have access to information about the houses themselves.
  • Input perception: How do they interpret all of the information they have, or how do they interpret the data when it’s completely messy and mostly patternless? e.g. certain aspects of houses are emphasized more than others, property values seem affected by certain things, etc.
  • Output perception: How do they interpret what they can do in the world to move around in it? e.g. probably have some knowledge about realtors and systems, but also how good it bad they are, what they think they can do to speed up parts of the process, etc.
  • Motor output: What can they actually do to act? e.g. only certain realtors exist in an area, only certain processes can be followed, with potentially unalterable timelines. There only exist a certain number of people looking to buy a particular house in the market.
  • Motivation/Reward: What do they actually care about? e.g. they want to not own a house anymore, they want to move states quickly, they want to not deal with realtors, etc.
  • Strategy/Policy: How are they going about their interaction with the world? What is their actual method they are doing now? Are they aware of it? e.g. they could be going through the motions of selling a house through standard ways because it’s only what they know, or have access to, or what they have time for. It they could have their whole process mapped out in detail with lots of pathways, scenarios, action plans.

Ultimately, Opendoor would want to work along all angles, but the largest pain point for people, at least in the beginning, was likely altering the actual actions people could take in the world — building the method by which to sell the house. Other aspects were also very important for making the sale happen, such as having all the right data for accurately pricing houses and to provide that information to people. The solving of the problem, however, focused on making a way to sell the house quickly with an automated efficient system.

Applying this to Insight

I find that most mentorship and guidance of software engineers or researchers in their professional development involves reframing their goals as transition processes from one state to the next. The aspects of mentoring and training, though, are focused on changing or augmenting part of this agent model.

Translating this computational agent-based view into a system for providing mentorship and education for these individuals takes the following form below. I’ve also indicated some potential solutions for how to add value when giving this advice and training.

  • States: What real world scenarios exist for people moving careers? Solution(s): Identify and communicate the landscape of new roles, responsibilities, management structures, or experiences people can have.
  • Sensory input: What information do these engineers have access to? Solution(s): Help engineers join meetings with others internally or externally, encourage them to interact with others they don’t typically engage with, help them see new offices, have them trial new roles.
  • Input perception: How do engineers interpret all of the information they have, or how do they interpret the data when it’s completely messy and mostly patternless? Solution(s): Guide people through how to interpret data in different ways, give your high level interpretations of messages or situations, point out salient opportunities that exist in the ongoing activity that’s happening at the company or externally in the field.
  • Output perception: How do your direct reports interpret what they can do in the world to move around in it? Solution(s): Guide people to learn different type of actions they can take in a particular setting, extra intuition on how different types of nudges and communications can succeed or fail, different styles for working effectively with different people.
  • Motor output: What can they actually do to act on the world? Solution(s): Provide situations where engineers can take the lead and influence parts of their company or external groups. Advocate for them to be considered for roles where they can do the things for which they have been preparing.
  • Motivation/Reward: What do they actually care about? Solution(s): Sit down with engineers and help them determine their personal and professional goals, help them reassess these to align them more throughout the company to be successful.
  • Strategy/Policy: How are they going about their interaction with the world? What is their actual method they are doing now? Are they aware of it? Solution(s): Provide examples of how their current workflows will result in suboptimal performance, help them self identify what things are doing well and not well, help them proactively plan by building roadmaps towards.

Next Steps: Providing the long-term sustainable business solution

Solving problems for users in the long-term involves looking at all your options for solutions, evaluating their potential for value, estimating how much value they provided, and determining how to monetize them. The business side of the process is then to set up the self-sustaining solution such that the money that’s captured from the provided service (revenue) is greater than the the effort to provide it (costs), thus making it a sustaining solution for long term impact.

Common Pitfall: People optimize for consumption

A common issue that happens in the above product design is that people want to optimize for consumption (sensory input), even though this is counter-productive to their true goals and underlies a failing strategy.

Users ask for content

When building product for users, especially when focusing on a risk-averse population, feedback you receive from users is that they want to know information because that is how they are going to be able to solve the challenges they are facing in life. Users prescribe that the solution is to focus in on the sensory input aspects — they want more raw data to consume. This is often due to the fact that they already have strong convictions that they know what they want in life (rewards), can interpret the data for themselves (input perception), and already feel like they would make the best decisions (strategy) given what they know how to do (output perception).

Users seeking career change ask for education materials

When mentoring and training people to take their lives and careers forward in a meaningful way, the ever exhausting mindset is the statement that people just want to be exposed to more information and learn as much as they can. One example I consistently encounter is the software engineer who wants to add more and more time to learn machine learning. The “need for educational material” keeps being presented as a critical piece to their development, and then they try to solve the problem by consuming more and more machine learning educational content.

What is often needed in this scenario is for several aspects to be altered to build a real solution to this problem:

  • First, help identify the real goal in life — if the aim is to do machine learning on a real problem for a real company and make a difference, then they need to re-organize their mental reward structure.
  • Second, obtain real access to problems and data at their company where they can actually work on a real problem (motor output), even if they don’t have 100% of the training.
  • Third, given them the intuition for how to actual identify real opportunities for leveraging ML, where ML is critical (input perception).
  • Fourth, provide them the ways to consistently be biased towards action and build more and more relevant ML projects instead of spending time watching videos (change their strategy).

The above is another reason you see a very large proliferation of educational products on the market that are just, at their core, content media companies where people are paying to consume ML material. It does not solve the actual problem of helping people do ML in their lives and in their careers.

I hope this provides another avenue by which to understand users, build solutions for them, and determine how to keep that solution sustainable for the long term. I’d love to hear from you all — Who is your product/company helping? How are they helping them? Is this solution sustainable?

Build Products for People

Low-cost Raspberry Pi robot with computer vision

The ever decreasing costs of hardware and the rise of Maker culture is allowing hobbyists to take advantage of state of the art tools in robotics and computer vision for a fraction of the price. During my informal public talk in San Diego’s Pint of Science event “Machines: Train or be Trained” I talked about this trend and got to show off the results of a side project I had been working on. My aim in the project was to create a robot that was capable of acting autonomously, had computer vision capabilities, and was affordable for researchers and hobbyists.

When I was an undergrad at IU in the Computational Cognitive Neuroscience Laboratory the trend was using Khepera robots for research in Cognitive Science and Robotics. These robots run close to $2800 today. Years later I was fortunate to help teach some high school robotics courses (Andrew’s Leap and SAMS) with David Touretzky (here are videos of course projects) and got to see first-hand the great work that was being done to turn high level cognitive robotics into a more affordable option. In the past few years, I’ve been helping to develop the introductory programming and robotics course (Hands-on Computing: SP13SP14, FA15, SP15) here in the UCSD Cognitive Science department and have really enjoyed using theflexible platform and materials from Parallax (about the course).

For awhile now, my advisor and I wanted to set up a multi-agent system with robots capable of using computer vision. While there exist some camera solutions for Arduino, the setup was not ideal for our aims. My friends had recently used the Raspberry Pi to create an offline version of Khan Academy and it seemed likely that the Raspberry Pi was up to the task.

Parts

I borrowed the chassis of the BOE Bot (includes wheels) and compiled this list of materials (totaling around $250 with the option of going cheaper, especially if you design your own chassis):

Set-up

While I had some issues with setting up wifi (UCSD has a protected network) and configuring an ad-hoc network, I don’t think it’s impossible to do. This was the procedure I followed to get the robot set up:

  1. Install Raspbian on Raspberry Pi: link (and directions for installation)
  2. Configure the Raspberry Pi: link (make sure to enable camera support)
  3. Update the OS: sudo apt-get update && sudo apt-get upgrade
  4. Install necessary software on Raspberry Pi: sudo apt-get install python python-numpy python-scipy python-matplotlib ipython python-opencv openssh-server
  5. Install python packages for RPIO (link)
  6. Setup Raspberry Pi to work with camera: link1 link2
  7. Setup Raspberry Pi to work with wifi: link

Wiring

The battery that powers the Raspberry Pi does not have enough power to run the Raspberry Pi and the servos at the same time. I used the battery pack from the BOE Bot and connected two wires to the servos — one at the point in the battery pack where the power starts and one where it ends, in order to use the batteries in a series. Much of the wiring is based on the diagram found here. The pin numbers for the Raspberry Pi can be found here (also shows how to blink an LED). Here is an updated diagram (while the diagram shows 2 batteries, there were actually 5):

Python

Learning python is awesome and will help with any projects after this one:

Controlling Servos

The control of servos is based on code found here. Use the following to center the servos (with the help of a screwdriver):

Using the Camera

There is excellent documentation for using the picamera module for Python:

Drawing a Circle

The easiest way to draw a circle on an image involves using cv2, the second version of opencv (code modified from here).

Demo

And finally, below is a demo to show off the proof of concept. This awesome (!) article shows how to use the Raspberry Pi Camera with OpenCV and Python (I found the ‘orangest’ object in the frame and had the robot turn towards it) and the above shows how to create circles on the images for display. I don’t recommend using the computer to view the output as this drastically slows down processing. It’s nice for a demo though! I hope you enjoyed this and found this useful!

Low-cost Raspberry Pi robot with computer vision