Skip to content

Instantly share code, notes, and snippets.

@dvf
Last active June 16, 2019 07:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save dvf/a1077719e36287659dccbe5a187c2e3f to your computer and use it in GitHub Desktop.
Save dvf/a1077719e36287659dccbe5a187c2e3f to your computer and use it in GitHub Desktop.
Blockchain: Step 1
class Blockchain(object):
def __init__(self):
self.chain = []
self.current_transactions = []
def new_block(self):
# Creates a new Block and adds it to the chain
pass
def new_transaction(self):
# Adds a new transaction to the list of transactions
pass
@staticmethod
def hash(block):
# Hashes a Block
pass
@property
def last_block(self):
# Returns the last Block in the chain
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment