Post
Topic
Board Announcements (Altcoins)
Re: [ANN][CLAM] CLAMS, Proof-Of-Chain, Proof-Of-Pearl, @Poloniex.com
by
dooglus
on 17/07/2014, 06:54:54 UTC
I was wondering whether it's possible to find out whether a particular Bitcoin address has any CLAMS associated with it without having to have access to the private key.

The helpful folks on the #clams IRC channel told me it is - you can convert from Bitcoin address to CLAMS address without needing the private key.

Here's one way of doing it, using the "python-bitcoinlib" library:

$ git clone https://github.com/jgarzik/python-bitcoinlib.git
Cloning into 'python-bitcoinlib'...
remote: Reusing existing pack: 913, done.       
remote: Total 913 (delta 0), reused 0 (delta 0)       
Receiving objects: 100% (913/913), 300.69 KiB | 145.00 KiB/s, done.
Resolving deltas: 100% (487/487), done.
Checking connectivity... done.

$ cd python-bitcoinlib/

$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bitcoin.base58
>>> def btc2clam(addr): return bitcoin.base58.CBase58Data(bitcoin.base58.decode(addr)[1:-4], 0x89).__str__()
...
>>> print btc2clam('14o7zMMUJkG6De24r3JkJ6USgChq7iWF86')
xC6ktEBwaTk8G27wCWwQjGmDuK14SZPvJa
>>>