Bitcoin Forum
February 19, 2017, 02:38:28 PM *
News: Latest stable version of Bitcoin Core: 0.13.2  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Subvertx Ubuntu packages (Oneiric Ocelot only)  (Read 1555 times)
Offline Offline

Activity: 1246

View Profile
November 06, 2011, 12:52:22 AM

Main thread:
Leave your comments there.

These are a simple set of utilities for working with the bitcoin network/protocol. Together you can use them as a 'flyweight' client. I like small sets of inter-working programs because it is the UNIX philosophy about building small bricks which you can piece together to create a set of highly configurable inter-locking mechanism of programs and daemons.

This is a proof of concept built off of the work-in-progress libbitcoin.

Subvertx is a suite of 4 tools:
- poller, downloads the blockchain from a bitcoind into a PostgreSQL database.
- balance, queries the PostgreSQL database downloaded with poller to find the balance of a bitcoin address.
- priv, create a new private key, sign data, verify data or show the bitcoin address of that key.
- mktx, connects to a bitcoind and sends some money from an output to a new address. You can use this in conjunction with a site like as a tool to make transactions very simply.

Show help:
genjix@random:~/subvertx$ priv
Usage: priv [COMMAND] [ARGS]...

The priv commands are:
  new Generate a new private key and output to STDOUT
  sign Sign the next argument using the private key in STDIN
  verify Verify the next argument using the private key in STDIN
  address show the associated bitcoin address

genjix@random:~/subvertx$ mktx

OUTPUT consists of a transaction hash and output index
AMOUNT uses internal bitcoin values
  0.1 BTC = 0.1 * 10^8 = 1000000

genjix:~$ poller

genjix:~$ balance
Usage: balance [BACKEND] [ADDRESS]

BACKEND consists of a colon separated list of parameters.

Make a new private key, sign and verify a transaction hash:
genjix@random:~/subvertx$ priv new > /tmp/private_key
genjix@random:~/subvertx$ priv sign f5cffc95a4a83c23cb9f666c7cf552f27d9845778bb09a98d5169c461483ba41 < /tmp/private_key > signed_data
genjix@random:~/subvertx$ priv verify f5cffc95a4a83c23cb9f666c7cf552f27d9845778bb09a98d5169c461483ba41 "`cat signed_data`" < /tmp/private_key

Show your bitcoin address:
genjix@random:~/subvertx$ priv address < /tmp/private_key

To send some bitcoins, you need to send some bitcoins to the address you generated above (in our case 14DDgj2r8WQEwfTDEjJFBn3wRnHmXzgB3z). Then you need to search the transaction on blockexplorer and find which output it got sent to.

In our case, the bitcoins we sent went to transaction 125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5 (the hash) and output 1.

Our destination address will be: 14UZVX5q1EcE4aT5k1c3eqw3oNUiCN3T23

The amount of bitcoins to send is specified in the bitcoin internal format (which is amount * 10^8):
0.01 BTC = 100 0000

It will then connect to the bitcoind on localhost:8333 and send it the transaction, which will be propagated throughout the network.

genjix@random:~/subvertx$ mktx localhost 125d49f6b826c564ea99345c56286de4b5126e3da38691caa4ccc68c8c8118d5:1 14UZVX5q1EcE4aT5k1c3eqw3oNUiCN3T23 1000000 < /tmp/private_key
1 peers connected.
s: version (85 bytes)
r: version (85 bytes)
s: verack (0 bytes)
r: verack (0 bytes)
s: tx (225 bytes)
20 5b f8 0b 8e 5a 54 5d 1f 10 5d 8b 72 e5 ff fd e8 c6 fb e7 b9 b3 ac 4d 8f 8d f5 9b 26 58 82 12

Those numbers are the transaction hash which can be looked up on blockexplorer.


To use the poller you first need to import the schema which can be downloaded from here (a pre-downloaded blockchain is here).

# do all the postgres stuff to make a new database
$ sudo su postgres
# createuser genjix
# psql
> quit
# exit

$ wget
$ psql bitcoin < bitcoin.sql

# it is a good idea to run this in screen
$ screen -S poller
$ poller bitcoin genjix psqlpassword localhost
... starts downloading the blockchain into postgresql
# now close the terminal. You can re-open the terminal with screen -x poller

Poller is doing full blockchain validation. It will take a long time since it's an SQL database and it's validating all the blocks.

Balance needs the full blockchain otherwise you might not get an up-to-date balance reported back. It's fairly simple to use:
$ balance postgresql:database:username:password 1jkjsjkdskjb2kkjbkjdsk

Ubuntu packages

The PPA can be viewed on launchpad.

Add these 2 lines to the end of your /etc/apt/sources.list
deb oneiric main
deb-src oneiric main

$ wget -q "" -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install subvertx

This PPA also has a package for libbitcoin-dev although the API is undocumented at the moment. Grin

Kamil Domański is working on an gentoo ebuild which should be ready tomorrow.

Source code for the non-Ubuntu paupers:

I can't stress enough for people to use this at their own peril as it's alpha software.

Thanks goes to,

Kamil Domański (kdomanski)
Jan Engelhardt (se7) <>
Patrick Strateman (phantomcircuit)
Denis Roio (jaromil)
Amir Taaki (genjix) <>
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Hero Member
Offline Offline

Posts: 1487515108

View Profile Personal Message (Offline)

Reply with quote  #2

Report to moderator
Offline Offline

Activity: 1246

View Profile
November 06, 2011, 01:09:00 AM

Source installation instructions

You will need:

  - g++ 4.6
  - cppdb
  - boost
  - libpq-dev
  - postgresql

Build cppdb using the instructions on their site.

  $ svn co cppdb-trunk
  $ cd cppdb-trunk
  $ mkdir build
  $ cd build

You can use -DCMAKE_INSTALL_PREFIX if you wish to install to a non-standard place such as a local directory.

  $ make
  # make install

Clone repo and build.

  $ git clone git://
  $ cd libbitcoin
  $ ./configure
  $ make
  # make install

Don't forget to initialise and create a database (see first post above for more details how).

  $ psql bitcoin < bitcoin.sql

Same for the subvertx suite

  $ git clone git://
  $ cd subvertx
  $ ./configure
  $ make
  # make install
Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!