Smart Contract basics

Do you actually know how smart contracts work? No? Me either. Ever since I started going down the rabbit hole with blockchain, I’ve been learning about blockchain basics. Without those, I’ll never be able to understand how protocols work. In my self-learning journey, I’ve neglected smart contracts. Why? Because I’m not a software engineer. But, that’s a poor excuse. Just because I’m probably never going to code a smart contract doesn’t mean I shouldn’t know how they work. So, here we go!

Smart contracts are pieces of code that can be stored in a blockchain, performing complex operations. It’s software with the ability of self-executing when one or many conditions are matched. The entire process is automated and can act as a compliment, or substitute, for legal contracts, where the terms of the contract are recorded in lines of code, as a set of instructions. Similar to a series of if-then statements that execute in a particular order.

Here’s a simple example of how it works. Suppose you wanted to charge your electric car with my charging station and we did this by blockchain buy transacting with cryptocurrency. You sent me some cryptocurrency and then you get a receipt which is held in our smart contact. I give you the digital entry key for my charger at a specified timeslot. If the key doesn’t come on time, the blockchain releases a refund. If I send the key before the timeslot, the function holds it releasing both the fee and key to you and me respectively when timeslot arrives. Everything is recorded where hundreds of people view it and delivery is irreproachable. The document is automatically canceled after the timeslot, and the code cannot be changed.

Most smart contracts are executed on the Ethereum network. Ethereum is an open source platform based on blockchain technology that enables developers to build and publish decentralized applications. Ethereum smart contracts are coded in a language called Solidity. I’m hoping to learn a little Solidity to be able to read smart contracts! Wish me luck 🙂

Privacy Coins

Source: Hakernoon

When Bitcoin came out, it revolutionized the way we think to transact. This would be the first time where you don’t need a trusted third party (bank) to validate your transaction. Instead, the transaction occurs on the blockchain where your public key data is logged on a public ledger. But what happens if you wish to be anonymous? Enter privacy coins.

Privacy coins keep the identity of the transactors concealed. Why might we need privacy coins (besides for hypothetically for illicit activities — not an advocation here!)? Perhaps you’re a business with transactions with a vendor that you want to stay secretive for a product launch. Or, perhaps you wish to make anonymous donations to charity and frequently use a pseudonym. Regardless of the reason, privacy coins are on the rise. I’ll go into the top three that are battling for crypto super dominance.

I evaluate crypto projects by network effects and clear adoption. The one that can achieve both will be the one that is super dominant one that may yield in investment returns.

Dash

Dash Chart.png
Source: Coin Market Cap

Released in 2014, Dash was created from a Bitcoin fork. To create privacy, it uses “PrivateSend” mechanism that mixes your transactions with other users and coins to cloak your actual transaction. Dash is based on a proof of work systems that when a miner validates the block, the block reward is split between the miner, master node, and a development treasury.

Zcash

Zcash chart
Source: Coin Market Cap

Launched in 2016 and also a fork from Bitcoin, Zcash uses zero-knowledge cryptography. Essentially it allows validation of transactions by the nodes without revealing any transaction data except for the time stamp. The rest of the data (sender, receiver, amount) is shielded. Some of the transactions occur in the transactions are shielded yet the majority are not. Zcash gives the option for both.

Monero

Monero Chart
Source: Coin Market Cap

Like Dash, released in 2014, Monero is an open source privacy coin that issues transactions with Ring Confidential Transactions. Unlike Dash or Zcash where privacy is an option, Monero is anonymous first. All transactions remain anonymous, untraceable, and unlinkable. I like Monero because it ensures complete fungibility. It’s also the coin that I mine!

Out of all these coins, Monero is my preferred coin because privacy isn’t an afterthought — it’s baked in. There have been some reports that Zcash is becoming centralized. I’ll need to further investigate. 

What’s a stablecoin

In the last few weeks, we’ve heard reports that Tether (#1 stablecoin in crypto), has been defrauding people. There are links to say that:

  1. Tether’s growth isn’t organic and is essentially printing money
  2. Tether doesn’t actually hold all the reserve fiat U.S. dollars it says it does
Source: Coin Market Cap

What’s alarming with these two acquisitions is that Tether has a market cap of over $2 billion dollars and even more alarming, it’s 24-hour trading volume is $2.4 billion dollars. With so much supposed U.S. dollars moving, I thought it would be good to do a brief overview of Stablecoins.

Stablecoins were created to reduce volatility in the crypto trading space. Thought of as a place to temporarily park your money when you don’t want to leave your positions in fickle coins. There are three different categories of stablecoins, Collateral backed-IOUs, Collateral backed-on-chain, and Seigniorage share coins.  They are typically pegged to a fiat currency (US dollar) or a crypto asset.

Collateral backed-IOUs are backed by fiat or traditional asset reserves. Collateral-backed-on-chain is backed by crypto assets. Seigniorage share coins algorithmically expand and contract the supply of the currency similarly to what a bank does for fiat.

ICO Mania

Source: Steemit

Hello from ICO Mania, the land where anyone can crowdfund a project with a little code, a little math, and a lotta smart contracts. Bitcoin price towards the beginning of January fluctuated around $15,000, a cool down from last year’s hype hovering around $20,000. But this cooldown isn’t stopping all the ICOs that are happening. So far for this month alone, there are over 30 ICOs to occur. More ICOs that days in the month.

It makes you wonder how many of the projects are real, functioning projects and how many are hoping dumping shit coins to get rich quick. Honestly, people are getting robbed. They are willing to shell out their fiat in hopes that this investment will pay off. The harsh reality: ain’t no one getting rich except for the ICO mania masterminds. Do these projects/protocols work? Can you install them and run the code? That’s what I’d like answered.

In honor of ICO Mania, the land of shitcoins galore, I’ll list a couple of my favorites.

  • Suncoin – generate sun warm and fuzzies from mining
  • Geocoin – a coin for geocaching (wtf does this mean?)
  • Duck Duck coin – “experimental payments” coin
  • Global Domination coin – purely listing for the name
  • H20 coin – generates water through mining… (just keep swimming y’all)
  • Oil coin – digital reserve currency backed by oil (the idea has merit but not compliant by OPEC standards)

See y’all on the other side where real network adoption is key!

Emergent Energy

It’s safe to say I know energy. Well, traditional energy. But what about emergent energy? Lately, I’ve become looking at energy blockchain projects to see what’s out there. Here are some that I’m starting to take deeper dives in.

Power Ledger

A peer-to-peer decentralized energy trading platform from Australia where residents can sell their excess solar energy to their neighbors. They’ve raised over $34 million dollars and are beginning to build the infrastructure for their pilot projects. From what I understand, they operate on a dual token model where POWR tokens fuel their network and Sparkz tokens are the ones redeemed for kilowatt hours of electricity.

LO3 Energy

A peer-to-peer trading platform and decentralized microgrid project from Brooklyn, NY. Originally from the ConsenSys family but not separated, LO3 hopes to build solutions for microgrids, distributed systems operators, EV charging, and a whole range of other customers. It’s actually quite difficult to understand if they are focusing on one specific idea or trying to be like an IBM solutions provider of energy + blockchain.

WePower

A green energy trading platform that does away with complex purchase power agreements where they connect you with renewable energy providers and issue smart contracts. They aim to be an end-user friendly business to alleviate the pain point of finding clean energy. This project is Lithuania based.

All of these projects focus on trading. I’d really like to see some projects focused on things that are usable. Trading is great but is subject to massive regulation in the US. Currently, p2p energy trading isn’t allowed in the US.

Use cases for blockchain in energy

oil blockchain
Image source: here

For a good chunk of my life, I’ve been interested in motion. Why do things move? How do we make them move? What is needed to sustain movement? It’s actually what drew me to the energy industry.

With the oil downturn, energy has been undergoing a revolutionary change to be more efficient. Gone are the days of clunky, gas-guzzling cars, replaced by sleek, clean electric options. Costly drilling platforms are not optimized operate leaner now, extracting that last bit of energy for unseen shale. Historically, when one sector undergoes mass change, so do others. In this case, the internet, particularly blockchain.

Blockchain technology has been touted as the new internet revolution. It has the ability up create smart contracts that are irreversible, ledgers that automated and accurate, and speed up transaction processing time. With all the advantages blockchain present, I wonder what are use cases for blockchain in the energy sector.

Over the next series of months, I’ll be dissecting use cases in blockchain and energy, market trend, current leaders, and most importantly, how does this affect the energy industry. I’ll start with simple use cases for blockchain and energy.

1) Peer to Peer Trading

Since blockchain technology functions as a contract and ledger system, the most obvious use case in energy is peer to peer trading. Think of selling excess solar energy back to the grid or to your neighbors. This allows a shift for prosumers and consumers to trade energy without the need for middlemen. Companies leading the charge in this are: Omega Grid, Power Ledger, and LO3 Energy

2) Renewable Investments

Part of blockchain’s appeal is that there are few barriers to entry on the investment side. Nearly any person can purchase coins for investment purposes. As a result, numerous renewable, clean technology projects have emerged for crowdfunding. Some are, ImpactPPA, MyBit, and Solar Coin.

3) Supply Chain & Logistics

With its ease in holding a record and tracking, blockchain applications become a massive asset to optimizing logistics for electricity supply as well as oil and gas supply. BHP Billiton already started implementing blockchain to manage their oil supply. (link here)

Crypto Mining Engineer

In my old day job, I drilled for oil. On one of those floating platforms armed with a glorified hyped-up robotic tool that broke the rock on the ocean floor and released oil. When oil busted, I wonder what was the best approach to transfer my skills.

I had this one year once-in-a-lifetime opportunity in private equity from chatting with someone at a Houston Texans game. Joining was the best decision I made. In that year, I worked closely with the Texans owner managing his personal portfolio. I helped him weather the storm with oil and gas and diversify with wind, solar, and alternative options. Aggregating data, creating analysis, forming valuations, and compiling it all in one handy report — I was hooked.

As someone who analyzed new technology day in and day out, I wondered what was next. Enter blockchain and the crypto curious craze. For most of my career, I’ve been in one the largest, volatile commodity markets. I’ve analyzed oil trends and forecasted prices through bear and bull markets.

Cryptocurrency will become the forefront of global commodities within due time. I believe so passionately about the internet money and blockchain that I taught myself how to mine for alternative coins on my laptop. (Though my CPU wasn’t too happy with me — more on that to come).

So I began to mine. Naturally, I gravitated towards to easiest coin that has relatively high value, Monero. Monero is a crypto coin centered around the idea of private, censorship-resistant transactions. To put it simply, Monero uses cryptography (the new morse code) to shield sending and receiving addresses and transaction amounts.

Crypto mining is essentially the checks and balance system for blockchain. Miners solve complex computer problem to allow them to validate and secure transactions and subsequently add them to the blockchain. When their task is complete, they are rewarded with the newly created coin. These rewards could be quite lucrative. To put things in perspective, Bitcoin miners who successfully validate and add to the blockchain are compensated with 12.5 bitcoins. If 1 BTC is roughly $8000 USD, that would be $100,000.

Time to enter the mining game. I had lofty, realistic goals to mine about $25 worth in Monero. Why? Cause it’s an experiment and us engineers like experiments. I needed to set a tangible goal that wouldn’t consume me but I’d see a full cycle like I did with drilling for oil.

Similar to being an drilling engineer as a crypto mining engineer I would source my resource (geological analysis), create my plan (reservoir & well planning), select my tools (rig selection, drilling configuration), mine for virtual commodities (drill, drill, drill), transfer the currency to my wallet (oil pipelines), adopt the currency to BTC through (refining crude to gasoline), and finally sell to the market (oil/gas traders).

Step 1: Make a “drilling” plan. Simple enough. I wanted to mine with the minimal number of moving parts. Monero mining can be done with your CPU meaning personal laptops are okay to use. Define parameters to measure (laptop utility, energy consumed, time lapsed, Monero price).

Step 2: Source a mining rig. I chose Minergate for this because 1) it offered a two-week free trial and 2) you simply install and go.

Step 3: Implement tools. All I needed to do was create an account with Minergate and install the software. Minergate automatically detects which drivers are needed to install for your mining rig.

                                   Downloads Detected

                                      Miner Rig Choices

Step 4: Start Mining. Honestly, all you had to do was open the app, log into your account, and then click which altcoin you wanted to mine. Easy, peasy. Minergate offers a variety of options for coins but I stuck with Monero.

                Congrats, mine baby mine

From here on out, I will be conducting this mining experiment. I will let you know about all my measured parameters. Naturally, the one I am most curious about is the energy consumption/efficiency. Only time and my electricity bill will tell what my little, old MacBook can handle.

          Mining Engineer

My Crypto Craze Part 2

What is Bitcoin, Blockchain, Proof of Work, and Proof of Stake?

In my previous post, I mentioned Bitcoin. But what exactly is Bitcoin? Bitcoin is a digital currency that is not backed by any country’s central bank or government. It can be traded for goods or services with vendors who accept Bitcoins as payment. Not quite “fake, paperless” money but a store of value.

Bitcoin is powered by a new paradigm shift in the organization, called blockchain. It is an incorruptible ledger that allows users to establish connections without the need for a middleman (third party) and records all transactions in a decentralized database. The system is enabled by a set of public (shared) and private (only visible to owner) keys. Each owner of Bitcoin transfers the coin to the next by digitally signing a hash of the previous transaction. The public key of the next owner and adds these to the end of the coin. (Adapted from the Bitcoin White Paper). The transactions are aggregated and then put onto a block. Each block contains about 2000 transactions with each block containing a unique identifier (a hash). All the blocks form a chain (a blockchain).

Since there is no third party to validate the transactions, another system needed to be created. Miners are the people who validate the blocks and add them to the chain. How it works is like so: Miners solve complex computational challenges for the system for the verifications of the transactions. After they have solved the challenge, they then add the block to the chain. Their reward is the newly created coin that they’ve just mined. Sometimes it is a whole coin, others it is a fraction. Mining requires tremendous computation power, think massive servers, but the payout could be monumental.

I like the think of Bitcoin mining similar to Sudoku. It takes lots of mathematical compute to solve a Sudoku puzzle. Each square in a Sudoku puzzle represents a transaction. When the Sudoku gets solved, it gets stored as a record. In blockchain, the record is a decentralized ledger. The puzzle solvers here represents the miners who are validating the transactions by adding into the Bitcoin blocks. After the puzzle is solved, its quickly checked by other miners. When a consensus is reached that the puzzle is correct, it gets added to the blockchain and the miner is rewarded. It takes a long time to solve the Sudoku puzzle but is easily checked. Bitcoin is the roughly the same.

Link: https://www.websudoku.com/syndication.php

This type of computation, validating, reaching a consensus, and then adding to the ledger is called a Proof of Work concept. You literally have to prove your work at every step in order for the system to function.

Another idea is Proof of Stake. This requires the user to show ownership of a certain number of cryptocurrency units. The creator of a new block is chosen somewhat at random, depending on the user’s wealth (stake). Blocks are forged in this system. Users who validate transactions and create new blocks in this system are referred to as forgers. Generally, at the launch of new digital currencies, the amount is fixed. Hence, the forgers receive transaction fees as rewards. In order to validate transactions and create blocks, a forger must first put their own coins up. Think of it was putting your holdings into a custodial account. If you validate a fraudulent transaction, you lose your holdings and rights to participate (cannot forge in the future). Once the forger puts their position up, they can partake in the forging process. In theory now incentivized to validate the right transactions since they have their own coins put up.

All of these theories and systems are greatly disrupting how we thin. More blockchain solutions are created serving different problems and markets. I for one would like to see where we go with this.

My Crypto Craze Part 1

While backpacking in Asia in 2016, I met some interesting people (read: extremely friendly and intelligent) who were telling me about a new currency. I had already heard of Bitcoin but wasn’t sure if it would become a disrupter or not. In full disclosure, I first heard about Bitcoin on my favorite TV show, The Good Wife, in 2013. If Alicia Florrick was defending it in court, then I must learn about it. Will this be the future?

The funny thing, talking to talented software engineers, gave me hope. Their excitement to develop something bigger than the internet itself gave them a pep in their step. Naturally, as someone easily excited, I started feeling their passion. I had to buy a small piece, $100 worth. Side note, $100 was 5x my daily budget for backpacking — I lived off $20/day.

These new friends were patient enough to walk me through how to buy Bitcoin on Coinbase. Let me tell you, Coinbase circa 2016 didn’t have a user-friendly interface as it does now. Let me also tell you, the verification process used to take days, 3 exact. My new friends made this process as seamless as they possibly could so I could have skin in the game.

Fast forward to now, nearly a year later, and that said $100 piece of Bitcoin is nowhere to be seen. Why? Because I didn’t have a hardware wallet at that time. Cue the facepalm.

 

Recession regression

I landed my dream job while in college, drilling engineer at a major oil company. The stars and universe collided and I was being rewarded. A simple system: study hard, pick a practical major (engineering), work for an oil company your entire career. No more job applications, interviews, ill-fated cover letters—it was all done. And for years and years, this worked well for me. I’d go from rig to rig, making it rain oil.

And then boom, oil busted. Suddenly from $100+ dollars a barrel, oil was $29. Worthless, devalued, my economics kryptonite — supply and demand didn’t work in my favor. There were oversaturated supplies with not enough demand. Oil companies couldn’t operate at these conditions and didn’t need so many employees.

Within a matter of months, that dream job became a ghost of the past. What to do? Enter the art of transition. Being analytical, I made charts and tables of what my skills were and how they can transfer. And then I thought about possible industries where these would cross over. And made more charts. I overwhelmed myself. I didn’t take time to breathe, reflect, rejuvenate.

When a crisis emerges, I go into full-on gladiator mode. I think, I do, I solve, and I repeat. But for this, it was like suddenly this gladiator didn’t have the right armor. I didn’t know what to do. I ran in circles because that’s all I was capable of doing.

Recession feels like a regression, but that’s only if you make it out to be like that. A setback. Instead, it’s a chance to try something you may never have thought to do. Yoga teacher, travel, become a YouTuber, go back to school, basically anything. And that’s what I did.

I backpacked and sought answers. I took the time to refresh and renew. I discovered a new technology and it’s safe to say I’m hooked.