Wanted to try how a wallet generation works.


Referencing this python code above. Hit into these errors below

wallet generator error 1

Looks like we will need to import the base58 library which we currently do not have.

  1. Download Base58 wheel file from https://pypi.python.org/pypi/base58/0.2.1
  2. Download Pip package manager https://pip.pypa.io/en/stable/installing/
  3. Put pip python source file in the python folder and run command in cmd python get-pip.py
  4. Now put the base58 wheel file downloaded in step 1 into the scripts folder and run cmd pip install <filename>

Now i get another error : ImportError: No module named ecdsa

Lol. Repeat step 1 to 4 using https://pypi.python.org/pypi/ecdsa

Now i get another error : ImportError: No module named utility belt

Repeat again using https://pypi.python.org/pypi/utilitybelt/

Finally its working but I am too tired to look at the codes now lol.


Python tips

Indentation is the open close brackets of the IF, ELSE, WHILE etc

For colour of the syntax, remember to save the file as xxxx.py python will auto colour the syntax


Loving python

The network will throw out a challenge (which is actually a random string of numbers and alphabets), and then we will need to append a random guessed answer to the back of this challenge and pass it to a SHA256 hash to generate out a sequence of 0s

Example 1 : We hard code the challenge as D8H6tYUHFN98JJHnBB7yUih54

Example 1 : proof of work 1

We notice the challenge doesn’t change, however the answer is a random generated answer which we program the system to “guess”

proof of work 1-ans

Example 2: We now concatenate the challenge + the random attempt together and then hash it proof of work 2

We notice that each time we call the function testAttempt() we generate out a hash to guess. And we ran it many times but still were not able to find one answer that starts with 0.

proof of work 2-ans

Example 3 : We now put the condition that only if the guessed hash starts with 3 – zeros than we accept it as an answer
proof of work 3

We see that our simple program managed to find a lot of answers. This also meant that any one answer can be accepted by the system as a valid answer.

proof of work 3-ans

Example 4 : Infinite loop until it finds the answer
proof of work 4

My computer took 9 secs to find the first answer with 4 zeros. So once the difficulty keep increasing, it might be exponentially unlikely for my 1 pc to find the answer

proof of work 4-ans

This in a nutshell is how proof of work works. I will expand electricity to proof to the network i did work. 🙂

The code snippet below

import string
import random
import hashlib
import time

example_challenge = ‘D8H6tYUHFN98JJHnBB7yUih54’

def generation(challenge=example_challenge,size=25):
answer =”.join(random.choice(string.ascii_lowercase +
string.ascii_uppercase +
string.digits) for x in range(size))

#print challenge
#print answer
attempt = challenge+answer
return attempt, answer


shaHash = hashlib.sha256()

def testAttempt():
Found = False
start = time.time()
while Found == False:
attempt, answer = generation()

solution = shaHash.hexdigest()
if solution.startswith(‘0000’):
timeTook = time.time() – start
print solution
print ‘time taken’, timeTook
print answer


#for x in xrange(0,100000):

Basics of hashing

Hashing has been quite a mysterious thing for me. So decided to research more on it.

Download python for the example code below
Python shell

Code :

import hashlib

md5 = hashlib.md5()

md5.update(‘This is a test hash’)
print md5.hexdigest()

Example 1 :
hash 1 produces a 32 bit char hash
hashing 1

Example 2 :
hash 2 produces 3 32 bit char hash regardless of what is the input.
Do note the 1st picture hash output is the same as example 1 which shows that the same input will always give the same output.
hashing 2

Example 3 :
hash 3 produces 4 32 but char hash, however even though we put in the same text, the output for 3 and 4 is different. So for the same input, we are considering the whole bunch as 1

hash test 3

Example 4 :
now we try to change the text in the 2nd line, we notice that everything from the 2nd line onwards changes, even the 3rd and 4th line, even though we did not change it
hash test 4

The order of input is important.


Apologies are simple if you are not sincere
Hard if you want to be sincere
Extremely hard if you want to be authentic


After the dip in all crypto, realized I have been a naive person for the past 4 months. What goes up must come down.

eth usd ta

ETH is stronger than BTC and for it to hit the 50 week MA is quite difficult.

If you are not urgent, set some buy order at 650-700 and 400 (unlikely to hit).

Creating our own monsters

we create our own monsters


how true