Wednesday, July 8, 2015

Census Protocol and Wallets

I started using (and fixing incidentally, if somebody wants to volunteer to help :-P ) the Census Protocol python library and it seems pretty handy so far.  I haven't pushed my latest changes to git yet - so if you're anxious just chill.  There was a bunch of stupid errors in the library as is that I just fixed.  Easiest thing to start with is the Census version of "Hello World."

The Census Protocol is a blockchain application that's made to send and record the possession of virtual goods. The software itself is planned to be open source - but it's not widely available yet since it's changing a lot still. A small cabal (sorry – I just like that word :) ) are working on it now and breaking each others changes the way that only nerds can – but hopefully it should be pushed to the public repo soon.

To verify the local node is running and mostly works - asking its version is the simplest.  This is through /api/v1/version or just using the version call in the library.


__author__ = 'lpreimesberger'
import censusprotocollib
import json

print "Hello world!  I'm trying to talk to the blockchain server on this host!"
print json.dumps( censusprotocollib.version("localhost"), sort_keys=True, indent=4, separators=(',', ': '))
print "Tada!"

Running this gives the expected output on my local system:
lpreimesberger@dadbuntu:~/projects/testthelibrary$ python testversion.py  

Hello world!  I'm trying to talk to the blockchain server on this host!
"{\"result\":\"ok\",\"vendor\":\"census foundation baseline implementation\",\"version\":{\"core\":\"0.01\",\"hard_fork\":1}}"
Tada!



Good start, right? Well, okay - that's pretty useless. You could do that in a web browser after installing the base packages.

Everything in Census is based around the wallets - if a node doesn't think there's a valid wallet existing in the blockchain (or at least its local coinbase) it will reject any item transfer to that address. For local submissions – it's rejected outright. If they are sent from other nodes they remain eternally in the graveyard until the consensus says they are good or the node sees a valid wallet create with a valid signature pass.

Next post will be trying to query the local database (again, baby steps) – and then using the library to generate a new wallet and try to do something useful. Since the wallets contain valid ECDSA and RSA public keys – we can probably make a ghetto PGP application pretty quickly.

No comments:

Post a Comment