Skip to content

Objective 11a - Naughty/Nice List with Blockchain Investigation Part 1


Objective 11

Link: tools

Tinsel Upatree tells you the following:

Howdy Santa! Just guarding the Naughty/Nice list on your desk. Santa, I don't know if you've heard, but something is very, very wrong... We tabulated the latest score of the Naughty/Nice Blockchain. Jack Frost is the nicest being in the world! Jack Frost!?! As you know, we only really start checking the Naughty/Nice totals as we get closer to the holidays. Out of nowhere, Jack Frost has this crazy score... positive 4,294,935,958 nice points! No one has EVER gotten a score that high! No one knows how it happened. Most of us recall Jack having a NEGATIVE score only a few days ago... Worse still, his huge positive score seems to have happened way back in March. Our first thought was that he somehow changed the blockchain - but, as you know, that isn't possible. We ran a validation of the blockchain and it all checks out. Even the smallest change to any block should make it invalid. Blockchains are huge, so we cut a one minute chunk from when Jack's big score registered back in March. You can get a slice of the Naughty/Nice blockchain on your desk. You can get some tools to help you here. Tangle Coalbox, in the Speaker UNPreparedness room. has been talking with attendees about the issue.

For this objective, you need to be Santa. Go to Santa's office and click on the Naughty/Nice List on the table next to Tinsel Upatree. This will download the blockchain that you need for this objective.

Objective 11


The terminal challenge for this objective is the "Snowball fight" that is offered by Tangle Coalbox in the UNPreparedness room.

Solving this terminal challenge provide additional hints for this objective. To view the hints or the walk-through for this terminal challenge, use the menu on the left.

To start this objective go to the Santa's Office and Download the blockchain data, and

There is a talk that may be helpful for this challenge.

To solve this challenge you need to read the blocks in blockchain.dat and extract the Nonces from each block. You will then need to feed the first 624 Nonces to the Mersenne Twister predictor (ex. This will allow you to predict nonces. You then need to step through the Nonces until you reach the 130000th Nonce.

To do this, extract Add to the script.

Add the following functions to

def SplitNonces(hexNonce):
     LSB = hexNonce[8:]
     MSB = hexNonce[:8]
     return MSB,LSB

def MergeNonces(a,b):
    return (b+""+a)

def ToDec(hexNonce):
    return int(hexNonce, 16)

def ToHex(dec):
    return hex(dec).split('x')[-1]

Update the main of as follow:

if __name__ == '__main__':

    with open('official_public.pem', 'rb') as fh:
        official_public_key = RSA.importKey(
    c2 = Chain(load=True, filename='blockchain.dat')
    print('C2: Block chain verify: %s' % (c2.verify_chain(official_public_key)))
    print (len(c2.blocks))

    # create our own version of an MT19937 PRNG.
    myprng = mt19937(0)

    #feed 624 Nonces to the Mersenne Twister predictor
    for i in range(0,mt19937.n,2):
        MSB,LSB = SplitNonces(hexNonce)
        myprng.MT[i] = untemper(ToDec(LSB))
        myprng.MT[i+1] = untemper(ToDec(MSB))

    #generate the Nonces for the existing blocks
    for i in range(y,len(c2.blocks)):
        MSB,LSB = SplitNonces(hexNonce)
        #print(c2.blocks[i].nonce, hexNonce,MSB,LSB, ToDec(MSB), ToDec(LSB), "pred:",myprng.extract_number(),myprng.extract_number())

    #predict the next 8 Nonces
    for i in range(129997,130001):
        PredictNonce= MergeNonces(ToHex(myprng.extract_number()),ToHex(myprng.extract_number()))
        print ("Predicted Nonce:", i, PredictNonce)

Running the updated gives you the following results:

Objective 10

The updated code can be downloaded here.


The 130000 Nonce is