Skip to content

Instantly share code, notes, and snippets.

@dvf
Last active February 22, 2018 21:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dvf/f453c191b7f76e7de5c8016d9c29e3cc to your computer and use it in GitHub Desktop.
Save dvf/f453c191b7f76e7de5c8016d9c29e3cc to your computer and use it in GitHub Desktop.
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
pass
def new_transaction(self):
# Creates a new transaction to go into the next mined Block
pass
@property
def last_block(self):
return self.chain[-1]
@staticmethod
def hash(block):
# Creates the hash of a Block
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment