0% found this document useful (0 votes)
48 views

Python Blockchain Developing Client

The document discusses developing a client class for a Python blockchain. It explains that a client holds and transacts cryptocurrency with other vendors on the network. The client class will allow users to send and receive money, with transactions specifying the sender, recipient, and amount. Developing the client class requires importing several Python libraries for tasks like signing transactions, hashing objects, and using public key infrastructure for unique IDs.

Uploaded by

Shrivas SP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Python Blockchain Developing Client

The document discusses developing a client class for a Python blockchain. It explains that a client holds and transacts cryptocurrency with other vendors on the network. The client class will allow users to send and receive money, with transactions specifying the sender, recipient, and amount. Developing the client class requires importing several Python libraries for tasks like signing transactions, hashing objects, and using public key infrastructure for unique IDs.

Uploaded by

Shrivas SP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Blockchain - Developing Client - Tutorialspoint https://www.tutorialspoint.com/python_blockchain/pyt...

Python Blockchain - Developing Client

A client is somebody who holds TPCoins and transacts those for goods/services from other
vendors on the network including his own. We should define a Client class for this purpose.
To create a globally unique identification for the client, we use PKI (Public Key Infrastructure).
In this chapter, let us talk about this in detail.

The client should be able to send money from his wallet to another known person. Similarly,
the client should be able to accept money from a third party. For spending money, the client
would create a transaction specifying the sender’s name and the amount to be paid. For
receiving money, the client will provide his identity to the third party − essentially a sender of
the money. We do not store the balance amount of money the client holds in his wallet.
During a transaction, we will compute the actual balance to ensure that the client has
sufficient balance to make the payment.

To develop the Client class and for the rest of the code in the project, we will need to import
many Python libraries. These are listed below −

# import libraries
import hashlib
import random
import string
import json
import binascii
import numpy as np
import pandas as pd
import pylab as pl
import logging
import datetime
import collections

In addition to the above standard libraries, we are going to sign our transactions, create hash
of the objects, etc. For this, you will need to import the following libraries −

# following imports are required by PKI


import Crypto
import Crypto.Random
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5

In the next chapter, let us talk about client class.

1 of 1 25/06/21, 18:21

You might also like