Hi all,
here are Prolog definitions for reasoning over Bitcoin addresses:
https://www.metalevel.at/bitcoinolog/
Bitcoinolog works with the latest git version of SWI-Prolog. It uses:
-) CLP(FD) for reasoning over elliptic curves (see
ecclog.pl)
-) library(crypto) to compute the various hashes that Bitcoin uses
-) a local OpenSSL installation to create Bitcoin private keys.
One important use case is offline creation of Bitcoin wallets.
Sample query, creating a sequence of Bitcoin addresses:
?- repeat,
new_private_key(PrivateKey),
private_key_to_public_key(PrivateKey, PublicKey),
public_key_to_address(PublicKey, Address),
portray_clause(Address),
false.
Yielding:
%@ '1FW7byVioVV3RZq8DdqiFt39qasXBxnRfF'.
%@ '19W72snScG3tZE6i3FASDaDx9s5htXEdEH'.
%@ '1JHGiDrhLfa6zfgw78kBxNNaZzaBJLq4fD'.
%@ '1FGV4gFcpHGMti4AQtFR767S2n92jpRGMH'.
%@ '1AuMaczcGqRuDTLNPTKWRswKKNaTQzi1ac'.
%@ etc.
Bitcoinolog is also available from a public git repository:
https://github.com/triska/bitcoinolog
Enjoy!
All the best,
Markus
--
comp.lang.prolog FAQ:
http://www.logic.at/prolog/faq/
The Power of Prolog:
https://www.metalevel.at/prolog