Last active
February 22, 2018 21:10
-
-
Save dvf/f453c191b7f76e7de5c8016d9c29e3cc to your computer and use it in GitHub Desktop.
Creating a simple Blockchain in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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