I’m an entire newbie within the Blockchain Growth world.
I’m making an attempt to create a really simplified P2PK (I do know it isn’t used anymore but it surely’s the place I would like to start out) blockchain system on Python.
For this, I created a private and non-private key for 2 customers that will probably be sending bitcoins to one another. Now, I’m making an attempt to create the blockchain system however regardless of how a lot I analysis, there aren’t a variety of assets for Python Code, and those I did see are too difficult for my stage of data in the intervening time. I’ve the genesis block and different blocks in txt recordsdata.
I would like some assistance on the best way to proceed subsequent. That is what I’ve:
class Blockchain:
def __init__(self):
self.chain = []
self.create_block(proof=1, previous_hash="0")
def create_block(self, proof, previous_hash):
block = {
"TxID": 0,
"Hash": "genesis block",
"Nonce": 0,
"Output": {
"Worth": 1,
"ScriptPubKey": "Person A's Pub Key OP_CHECKSIG"
}
}
self.chain.append(block)
return block
def print_previous_block(self):
return self.chain[-1]
I took https://www.geeksforgeeks.org/create-simple-blockchain-using-python/ instance and wish to implement my transaction (knowledge saved in “block” variable above) on it, however I actually am unsure the best way to.
