Skip to content

Instantly share code, notes, and snippets.

@dvf

dvf/blockchain.py

Last active Feb 22, 2018
Embed
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
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