Skip to content

Instantly share code, notes, and snippets.

View shuq007's full-sized avatar

S. Habeeb Ullah Quadri shuq007

View GitHub Profile
@shuq007
shuq007 / sample_coin.py
Created February 17, 2021 03:00
sample_coin.py is a simple blockchain module in python2
#!/usr/bin/env python
import hashlib as hasher
import datetime as date
# Define what a simple coin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
@shuq007
shuq007 / blockchain_example.py
Created February 17, 2021 03:10
Simple Blockchain example in python3 that mines a block (without nodes)
#!/usr/bin/env python
# coding:utf-8
import hashlib
import time
class Block:
def __init__(self, index, proof_no, prev_hash, data, timestamp=None):
self.index = index