Smart Contract Introduction - Part One

Smart Contract Introduction - Part One

This is the first of a multi-part series exploring smart contracts. It will explore the concepts and history of smart contracts, and go into depth for several specific use cases of smart contracts. This series is aimed at beginners, and will go over all of the necessary foundational information required to understand smart contracts. Although several platforms exist to deploy smart contracts to, this series will focus on the Ethereum blockchain.

So, what is a smart contract? Simply put, a smart contract is a piece of software that stores the negotiated terms of a contract, and then automatically executes those terms. This is a very powerful innovation in peer-to-peer interaction, and has the potential to profoundly disrupt both law and business. The innovative power of the technology cannot be overstated, and this concept cannot be compared to legal contracts as we know them. A legal contract explains to an outside arbiter what the agreement was beforehand, so that if (when) that agreement is not met by one or more parties, that third party can intervene and award reparations based on the recorded terms of the agreement and their discretion. This is a messy and often expensive way for businesses or individuals to operate, and within this framework the explicit agreement is only referred to should their be a perceived deviation from it.

A smart contract, takes the terms that were agreed to beforehand by both parties, and ensures the execution of them. No one can intervene, no one can use asymmetrical power structures to abuse agreements made in good faith, and because smart contracts are deployed to a blockchain, there is a timestamped proof of the contract that is held in a decentralized way by thousands of nodes acting as impartial third parties around the world.

The term “smart contract”, and its underlying concept was first coined by Nick Szabo, cryptographer and expert in digital currencies in 1994. He envisioned smart contracts as “a set of promises, specified in digital form, including protocols within which the parties perform on the other promises". The contracts taking a digital form instead of the typical form, written on paper and enforced in courtrooms offer a very significant difference. Collapsing the terms of the agreement, and the execution of that agreement into a single operation is significantly more efficient than legacy alternatives. It most certainly will save money, because these agreements can be drawn up and deployed without expensive legal counsel, but it will also save the time of parties on the potential wrong end of a dispute. Ensuring from the outset that established rules cannot be broken ensures that all parties involved are negotiating in good faith, because it is enforced by code.

The largest platform that is presently available to build smart contracts for and deploy them to is the Ethereum blockchain. Ethereum was conceived and proposed in late 2013, by Vitalik Buterin. It was built in 2014, and released as a beta platform in mid 2015. Since then, developers have been building smart contracts and decentralized applications for the platform that address a variety of use cases. At present it is the most built out platform for smart contracts and decentralized apps, and has several high-level turing complete programming languages as well as JavaScript npm modules to facilitate implementation and access through the web.

The most common programming language used to develop Ethereum smart contracts and decentralized applications (dApps) is Solidity. Solidity bills itself as “...a contract-oriented, high-level language whose syntax is similar to that of JavaScript and it is designed to target the Ethereum Virtual Machine (EVM)”. As a programmer who came up on Object-Oriented Programming (OOP), the similarities between OOP Solidity and functional JavaScript start and end with how the start of a function is declared, but I suppose that is a discussion for another article. Solidity is statically typed and objectively OOP, so to take a glance at it, it looks like Java with some C++. Solidity comes with extensive documentation, complete with code examples and no shortage of community developer support if you know where to find it. It also has an online code editor that acts as a real time compiler, which is extremely helpful to new developers and allows anyone interested to get started writing smart contracts.

The ultimate purpose of Solidity, as previously mentioned, is to be a high-level programming language to build smart contracts. The Solidity code is put through a compiler, there are also several implementations of the compiler if you have any specific preferences. The compiler outputs opcodes, which are a low-level language, similar to assembly code, which is for the consumption of the Ethereum Virtual Machine (EVM). The EVM is a computer, built into the Ethereum blockchain that executes opcodes, thus performing the functions that are built into smart contracts. In order to prevent nefarious or poor code from disabling the network with an infinite loop and stalling all of the nodes running the code, which in the case of decentralized blockchain would be all of them, the concept of Gas and paying for the computation used was built into Ethereum. These are very complex topics, and entire article series’ could be written about each of them, so if I’ve stirred your curiosity I encourage you to do more research.

I’ve tried to cover the foundational topics of smart contracts as they relate to the Ethereum blockchain without adding unnecessary complication to avoid confusion. However, if you are like me and benefit from an experiential approach to learning the rest of the series will be of interest. Over the next several parts of the series I will go over building and deploying smart contracts from very basic “hello world” contracts, to escrow contracts, coins and more, so please check back often.

Blockchain Government Forum, Ottawa 2017

Blockchain Government Forum, Ottawa 2017

By now, it is well known that blockchain tech has caught the eye of the federal government and Canada’s big banks. So it is not surprising that as a company that aspires to solve one of the most intractable problems of the construction industry, the late payment, Arkilio would be interested to connect with government officials that care about this topic.

The Blockchain Government Forum that took place between June 12 and June 13th in Ottawa and was organized by the Blockchain Association of Canada, presented one such opportunity.

This forum was setup to promote a better understanding of the true potential of blockchain technology and offer opportunities to interact with federal government officials, bureaucrats as well as regulators.

Arkilio opted for the same mode of transportation that we used when visiting New York Token Summit in May. The drive was much shorter and the weather was nice. Probably the most memorable part of the drive was witnessing how a Honda Odyssey can "chew" roads at 100 km/h on 7.6 l. This is quite remarkable considering the car can carry 8 passengers.

This was also the first time ever Arkilio used Airbnb since all the hotels in downtown Ottawa were fully booked. The room was recently renovated but in an older house close to the University of Ottawa.  Watching the middle class family that owns the house putting in serious weekend hours to renovate the house just so they can lease the rooms for $70/night, made me wonder if Airbnb is such a long lasting disruptive technology after all. Pitting private property owners against hoteliers seems mainly to serve the Airbnb financial interests. With no economies of scale on their side and with high customer service expectations, it is hard to imagine how property owners will come out of this battle as winners.

The Blockchain Government Forum was held at the Innovation Centre at Bayview Yards, just 5 minutes from Parliament www.thebayviewyards.com. The Innovation Centre is based in a recently renovated 46,000 sf municipal building located at 7 Bayview Road, about 75 min walk from the Airbnb "hotel".

The conference opened with Michael Tremblay from Invest Ottawa followed by Steffen Christensen, a Senior Policy Researcher at Policy Horizons Canada,  Sunny Ray, Co-Founder of Unocoin, the India's largest bitcoin wallet provider and Manav Gupta from IBM Hyperledger. Afternoon speakers included Ethan Wilding from Ledger Lab and Philippe Chevry from Nash.

The second day started with breakfast followed by a keynote from Amber Scott from Outlier Solutions discussing various compliance aspects of blockchain tech and presentations by Adam Cole from HealthChainRX discussing prescription use case, Samson Mow from Blockstream & Joseph Weinberg from Paycase introducing the Blockstream Liquid Network and Illiana Oris Valiente from ColliderX discussing new business model to fund research.

The speakers that left the deepest impression on us were Steffen Christensen and Sunny Ray. Steffen because of his deep knowledge of a wide breadth of research topics and Sunny because of his personal story of discovering bitcoin and founding Unocoin.

Samson Mow from Blockstream and Joseph Weinberg from Paycase were leading the list of the most impressive speakers from the second day of the forum. Joseph's impressive command of the blockchain technology and Samson's politeness that is in such a stark contrast to his hard-hitting online persona were refreshing, surprising and educational.

We returned to Toronto happy to have connected with all the speakers, having a good chat with Adam Cole, his HealthChainRX team and Sunny Ray. Arkilio got to know some dynamic personalities like Loretta Joseph, an advisor to Sidney Stock Exchange and Kyle Kemper, Executive Director at Blockchain Association of Canada.

We returned home with few key takeaways:

  • We need more forums like this. Forums that bring government officials and the blockchain community together promote a constructive and informed conversation that should result in a more pragmatic and technology-friendly regulatory environment in the future.
  • Brainstorming breakout sessions were refreshing and useful and other conferences should consider adopting them. The brainstorming sessions provided an opportunity for interaction between speakers, organizers as well as attendees. When conducted by professional facilitators, they are also an opportunity to learn the craft of brainstorming from the best.
  • Conference organizers should be willing to take little bit of risk and provide more podium time to startups or companies that are not well-known in the industry. The future Google of the blockchain world may have not been born yet. And the forums like this should be an opportunity to introduce the "veterans" of the industry with the "newbies".

 

Sunny day, with a full tank, looking forward to the trip.

Sunny day, with a full tank, looking forward to the trip.

Impressive Honda, how did you manage to make minivans for 8 passengers doing 7.6 l/100km??

Impressive Honda, how did you manage to make minivans for 8 passengers doing 7.6 l/100km??

You cannot but admire some people's enthusiasm for Christmas. It's 30 degrees Celsia and humid. Merry Christmas Ottawa!!

You cannot but admire some people's enthusiasm for Christmas. It's 30 degrees Celsia and humid. Merry Christmas Ottawa!!

Signs of pump and dump everywhere. Even the construction industry is talking about the crazy ICO market  : -)

Signs of pump and dump everywhere. Even the construction industry is talking about the crazy ICO market  : -)

Kyle and Christina welcoming everyone on the first day of the conference.

Kyle and Christina welcoming everyone on the first day of the conference.

Michael Tremblay wishing all the best to the attendees.

Michael Tremblay wishing all the best to the attendees.

Impressive keynote by Steffen Christensen from Policy Horizons Canada.

Impressive keynote by Steffen Christensen from Policy Horizons Canada.

Story of money told in a personal way by Sunny Ray. Go Sunny, go. We are rooting for you!

Story of money told in a personal way by Sunny Ray. Go Sunny, go. We are rooting for you!

Power of collective mind. What happens when we live to 110 years of age? My Facebook account runs out of space!!

Power of collective mind. What happens when we live to 110 years of age? My Facebook account runs out of space!!

Samson Mow, Blockstream and Joseph Weinberg, Paycase presenting the Liquid Network.

Samson Mow, Blockstream and Joseph Weinberg, Paycase presenting the Liquid Network.

How about capture all what was said in artistic sketches? Neat and original idea.

How about capture all what was said in artistic sketches? Neat and original idea.

Congratulation to 150th birthday Canada!  Looking good.

Congratulation to 150th birthday Canada!  Looking good.

Token Summit, New York City 2017

Token Summit, New York City 2017

May 25, 2017 Arkilio attended inaugural conference on token-based economy in New York City. The event was held at the prestigious Paulson Auditorium at NYU Tisch Hall, a theater-style venue that can accommodate up to 470 seated participants and which is part of the NYU School of Business.

Token Summit was the first-of-its-kind event dedicated to the exploration of the economics, regulation and best practices around blockchain-based tokens. The main target audience of the conference were entrepreneurs, investors, lawyers and fund managers active in the space.

Arkilio went to the conference to learn more about crowd-funding of token-based crypto platforms and meet new friends. We were not disappointed, and judging by the informal feedback, neither were the 560 attendees. The event organizers, William Mougayar and Nick Tomaino, have delivered an engaging conference filled with substance and one that did not shy away from difficult conversations.

Our main takeways:

  • We are in the midst of a new global funding experiment where young entrepreneurs, often with limited business experience and no product, can raise $5M to $20M through token sale process generally bypassing national security registration requirements. The raised funds can then triple or quadruple in value due to the rapid price appreciation of raised crypto assets (typically ETH, less so BTC).
  • There was a general recognition in the room that regulators will eventually step in and that this is most likely to happen in the event of a major fraud or bankruptcy of a few prominent crypto startups. No one in the room felt comfortable to predict timing of such an event. Our own feeling is that in the next two years, time within which most reasonable startups should be able to go to market with a product, we will start seeing first high-profile failures.
  • But people also agreed that the token-based economy and decentralization potential of blockchain-based platforms are the most disruptive forces that are here to stay regardless of what happens with the new crowd-funding model or the crypto asset prices. Most people we spoke to agreed, that the companies that will take advantage of these forces and will execute well, will lead the next technology-driven disruption cycle. 
  • Finally, the conference confirmed our earlier feeling that Arkilio needs to consider itself to be a globally-connected company. The talent working on blockchain technologies, innovative ideas and funding are all globally distributed now. Moreover Arkilio clients often operate across national jurisdictions. The conference was an eye opener for us. We have met many interesting people and made new friends. This effort must continue.

The most memorable moments:

  • When Bill asked who owns cryptocurrency (BTC) or token (ETH) most people raised their hand. When he asked who used them for payment or to acquire services, only few hands went up.
  • According to CoinFund survey, over 90% of token investors are male, 66% are between ages 25-40 years old, 60% worked in technology firms and 26% were accredited investors. The average respondent invested 50% of all their investment capital in blockchain assets and 33% of respondents invested more that 75% of all their investment capital.
  • Chat service Kik, which has 50M monthly users, has announced token sale. Justification for it was "we always meant to have a token".
  • Fred Wilson, managing partner of Union Square Ventures, making a prediction that all of the existing top 5 crypto currencies will be unseated in the not too distant future.

 

Journey to New York City Token Summit begins here.

Journey to New York City Token Summit begins here.

Sir, do you have any bitcoins to declare ??

Sir, do you have any bitcoins to declare ??

New York City in sight....

New York City in sight....

Promoting Nike hat at Token Summit :)

Promoting Nike hat at Token Summit :)

Connected with a dear friend Victor Li, a self-described crypto junkie with a serious analytical side.

Connected with a dear friend Victor Li, a self-described crypto junkie with a serious analytical side.

Luke Williams from Berkley Innovation Labs welcoming everyone.

Luke Williams from Berkley Innovation Labs welcoming everyone.

Bill describing blockchain ecosystem evolution. Make a guess what is the last missing block at the bottom right corner??       .... EVERYBODY  :)

Bill describing blockchain ecosystem evolution. Make a guess what is the last missing block at the bottom right corner??       .... EVERYBODY  :)

Fireside chat with ShapeShift Eric Voorhees. Announcing PRISM, Portfolio management platform for crypto assets.

Fireside chat with ShapeShift Eric Voorhees. Announcing PRISM, Portfolio management platform for crypto assets.

Very impressed by SIA, no flashy stuff, just focus and interesting technology..

Very impressed by SIA, no flashy stuff, just focus and interesting technology..

Had an interesting conversation with Andy Milenius from MAKER. It  turns out he cares deeply about land and buildings.

Had an interesting conversation with Andy Milenius from MAKER. It  turns out he cares deeply about land and buildings.

Interesting presentation on how to value crypto tokens by Chris Burniske from ARKInvest.

Interesting presentation on how to value crypto tokens by Chris Burniske from ARKInvest.

Using novel stats like number of developers and size of communities as a valuation parameter.

Using novel stats like number of developers and size of communities as a valuation parameter.

And what do investors have to say? We were very impressed by Olaf Carlson-Wee from Polychain Capital. Optimistic and focused. Yet the guy shows up in running gear. With Andreessen Horowitz and Union Square Ventures as backers, we should be able to do that as well.

And what do investors have to say? We were very impressed by Olaf Carlson-Wee from Polychain Capital. Optimistic and focused. Yet the guy shows up in running gear. With Andreessen Horowitz and Union Square Ventures as backers, we should be able to do that as well.

Blockchain Canada Special Meetup, May 16th 2017

Blockchain Canada Special Meetup, May 16th 2017

On May 16th 2017, Blockchain Canada has hosted a special meetup dedicated to insurance industry's use case. Cristina Ignatenco from Manulife was a keynote speaker of the event and presented her views of challenges and opportunities of the new technology from the insurance industry's perspective.

The presentation again highlighted the strong appeal of private consortium blockchains to large corporations. However, we believe that this use case significantly waters down the benefits of distributed ledger technologies. It also raises potential antitrust issues and makes us wonder what happens to all the data when a corporation decides to join another consortium.

Arkilio was also asked to present as one of the three winners of the BlockgeeksLab Hackathon. Unfortunately last week's update of Web3.js libraries has destabilized our hackathon demo and Mark Gituma and Tom Yano had to work overtime to ensure we have something to present.

Mark and Tom delivered and our presentation and demo was received well. Kregg being a practicing architect can tell the Arkilio story in a way that people can relate to. Many follow up questions confirmed our feeling that we are pursuing a goal that people can understand and see the tremendous benefits of.

Thank you Alan (Blockchain Canada) for organizing this event and thank you to all those people that showed up and asked questions.

Inspiring presentation by Cristina, self-educated blockchain enthusiast.

Inspiring presentation by Cristina, self-educated blockchain enthusiast.

Mark doing his magic and pretending to be architect submitting a payment request.

Mark doing his magic and pretending to be architect submitting a payment request.

Attentive audience listens to Alan's update on Board of Directors' election.

Attentive audience listens to Alan's update on Board of Directors' election.

With Kregg talking, not much for Mark to say.

With Kregg talking, not much for Mark to say.

"How do you deal with resistance to adopt automated payment?" Great question! Here is how we answer it. "Economic incentives via lower design fees combined with industry associations' pressure targeting public segment of the construction market." At least that is our working thesis. Prompt Payment Ontario initiative gives us a hope we have a fighting chance.

"How do you deal with resistance to adopt automated payment?" Great question! Here is how we answer it. "Economic incentives via lower design fees combined with industry associations' pressure targeting public segment of the construction market." At least that is our working thesis. Prompt Payment Ontario initiative gives us a hope we have a fighting chance.

Great presentation by HealthChainRx, BlockgeeksLab Hackathon winners and Toufi from PrivacyShell. 

Great presentation by HealthChainRx, BlockgeeksLab Hackathon winners and Toufi from PrivacyShell. 

Thank you Alan for giving time to all the aspiring startups!!!

Thank you Alan for giving time to all the aspiring startups!!!