Skip to content

Instantly share code, notes, and snippets.

Last active February 22, 2018 21:10
What would you like to do?
Creating a simple Blockchain in Python
class Blockchain(object):
def __init__(self):
self.current_transactions = []
self.chain = []
def new_block(self):
# Creates a new Block in the Blockchain
def new_transaction(self):
# Creates a new transaction to go into the next mined Block
def last_block(self):
return self.chain[-1]
def hash(block):
# Creates the hash of a Block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment