2.28.2021

Blockchain the expensive word — and with my implemented with Python...

Simple and for some the remote Blockchain and for some an encrypted APP or Information block system..

We’ve all heard the stories of overnight crypto riches. But will cryptocurrencies (or blockchain, their underlying data structure) revolutionize the world? Or will they remain a fascinating experiment in open-source? Nobody can say for sure.

Either way, they’re a lot of fun to write!

What is a BLOCKCHAIN ? 

Skip ahead if you’re already familiar, but basically, a blockchain is open-source software that is shared between thousands ...thousands of computers. These computers all follow a set of rules to track money that’s been sent from accounts tied to the blockchain software.

Each “block” is a group of data that says, for example, “Alice paid Bob $100 on Monday, February 15th.” On the blockchain, I can send you money without using a bank!

WITHOUT BANK ! 

WITHOUT CENTRAL COMMANDER... 

For part this project you’ll only need Python.  Ya Python language and run ...

Keep in mind, our blockchain will be a simplified, high-level introduction…we won’t build the full-blown Bitcoin blockchain. Instead we’ll create functions to add blocks, transactions, and encryption so that our data’s tamper-proof. 

One taste ...little taste implementation ... 

א – Defining our blockchain class and variables  (oop implementation)












First step: imports :  "hashlib"

Need hashlib for the encryption, JSON to format our blocks, and timefor each block’s timestamp.  

Since we’ll be writing this with object-oriented programming in mind, let’s create a Blockchain class and initialize the following variables:

chain:anempty list that we’ll add blocks to. Quite literally our ‘block-chain’.

pending_transactions: when users send our coins to each other, their transactions will sit in this array until we approve & add them to a new block.

new_block: this is a method that we’ll define soon, and we’ll use it to add each block to the chain.

Let’s borrow Satoshi’s message from the Bitcoin genesis block (the very first block ever mined) for inspiration ...as example concrete.


22 old years in software dev ...language programming ...

Soon I will publish other parts of this taste ...










No comments:

Node.js?

  Node.js? It is JS or Javascript yes, it is the basis.  Yes the old Javascript that today has a strong front and back end stack, the same s...