Thursday, August 6, 2015

Searching for Census Wallets

Okay, so the next step would be finding another wallet to do the operations on.  We know who we are, but how to find something else?

Quickest and easiest is by just hitting your local Census instance with the wallet id.  Census wallet id's are the same format as the usual bitcoin one.  The id number is a defined value that is a hash of the public wallet, which in turn is the hash of the larger private wallet key.  Early drafts of Census used variations of the basic Bitcoin wallet to differentiate it - but every one of these changes just made the network harder to manage and made less and less of the public code usable.

End result is - a Census wallet is almost the same as a Bitcoin wallet.   Most of the time, you could feed in your Bitcoin private key into the Census code and get a wallet with the same address for your digital items.  That's a terrible idea though - so don't please don't do that.  Generate a new key from some random data and add it.  Census is pretty secure - but if some vendor or online wallet is compromised you don't want your real money to disappear along with your digital items.  Spreading your assets out over more keys makes it less likely somebody can make away with all your stuff.

The URL to get a wallet by the wallet id is get a GET on the wallet route.  So this:

http://localhost:9000/api/v1/wallet/1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T

Would just barf out the wallet itself for that id:

[{"balance":0,"version":1,"created":1436734011857,"txid":"433225d2-e843-4448-a97d-aefaf4b5d5a0","item_type":"wallet","tag":"generated by censusprotocollib","source":"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T","signature":"","block_in":"","email":"ilovecats@cathuggers.com","rsa_keys":["-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAseG7lt/JwOHyzG0hKbKQ\niDmiQ0bTY+mg6AQq8wdZx3lQF0BOWCtnYYxVL+zWr2fqMqjtsc6rC11p4VvmojBm\nGZAEMH1um+sUAzMLKellAdfRNH1XRA5Ag/treaWOlmY/2ilTfq2raSgq/Ed/kGix\nl+NynzgNiKqFVbBbCZ4rvPmkiyEmygpuLXU5MO8qOSpX1cegauByciKxcdqcBLjg\nQgj7XLO9eqGCX/ypzysXPAIgdWIUrZci8gjdJf65eQBywaQ1jLTpASV3kzY4pB4d\n3lBWZuIe5Ck65ZVQjeaPXgYVDLUFp+R2eERWAWydaKLqaSaL3NGg6XMuqoFzx0Ex\nrQIDAQAB\n-----END PUBLIC KEY-----"]}]

Wallets are case sensitive though - 1Jw is not the same as 1JW, so don't normalize the data.

Census is not as privacy mad as Bitcoin and most of the altcoins - people can't find or remember wallet addresses.  They are just too many digits and the format is sort of weird.  People can remember phone numbers and email addresses - but it's really unreasonable to think your friend can remember that you are 1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T and send you something.  You don't need to add an email address - but if you do you can make life easier.


http://localhost:9000/api/v1/wallet/email/ilovecats@cathuggers.com

Will return the wallet that matches that address:

[{"balance":0,"version":1,"created":1436734011857,"txid":"433225d2-e843-4448-a97d-aefaf4b5d5a0","item_type":"wallet","tag":"generated by censusprotocollib","source":"1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T","signature":"","block_in":"","email":"ilovecats@cathuggers.com","rsa_keys":["-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAseG7lt/JwOHyzG0hKbKQ\niDmiQ0bTY+mg6AQq8wdZx3lQF0BOWCtnYYxVL+zWr2fqMqjtsc6rC11p4VvmojBm\nGZAEMH1um+sUAzMLKellAdfRNH1XRA5Ag/treaWOlmY/2ilTfq2raSgq/Ed/kGix\nl+NynzgNiKqFVbBbCZ4rvPmkiyEmygpuLXU5MO8qOSpX1cegauByciKxcdqcBLjg\nQgj7XLO9eqGCX/ypzysXPAIgdWIUrZci8gjdJf65eQBywaQ1jLTpASV3kzY4pB4d\n3lBWZuIe5Ck65ZVQjeaPXgYVDLUFp+R2eERWAWydaKLqaSaL3NGg6XMuqoFzx0Ex\nrQIDAQAB\n-----END PUBLIC KEY-----"]}]


Easy enough right?  Now that we have a public id - we can send stuff pretty easy.

No comments:

Post a Comment