States in coinflip game

  • [Heads] - [Win]?
  • [Tails] - [Loose]?

States in tic-tac-toe game

  • [Started], [Playing], [Won], [Loose] and [Tie]

States in rubik's cube solving

  • [Mixed], [Cross], [First Layer], [Second Layer], [Yellow Cross], [Solved]

What is Layer 1

  • Layer 1 is the protocol itself
  • It can be changed by block size, consensys mechanism, sharding, DAG (asynchronous fault tolerance…..which should fall under consensys mechanism?) etc
  • Can also be known as vertical scaling

WHat is Layer 2

  • Refers to solutions that happen off the blockchain
  • For scalability this can be
    • State channels
    • Bridges
    • Plasma
  • Can also be known as horizontal scaling

State channel characteristics

  • Members allowed to interact with it
  • Rules of the game
  • Changing of state
  • Disputes of changing states

Rules of Tic Tac Toe

  • Once player A plays, it is player B’s turn
  • A player wins when there are 3 consecutive letters in one direction
  • A game may not have a winner

State channel smart contract

  • State channel is the third party arbitrator
  • Define the rules of the game
  • Handle payments, if necessary

Signatures

  • The way for smart contracts to verify information
  • Assumption: The owner of the private key is the owner of the account
  • Sign data using private key
  • Unforgeable signature on an important letter

Signing and Verifying Messages in Ethereum

  • Cryptographic signatures are a powerful primitive in Ethereum.
  • Signatures are used to authorize transactions
  • Signatures can be used to prove to a smart contract that a certain account approved a certain message.

Cheque Cashing

Image source

Lab

Follow the instructions on the readme file of long-lived-payment-channel

References