You can download a dump of the whole blockchain database from dumps.webbtc.com

This page details the database schema and explains what the columns are used for.

schema_info

Information about the current schema version, network and backend used.

version integer Schema Version of the migrations
magic varchar Magic Bytes identifying the network (bitcoin, testnet, namecoin, etc)
backend varchar The name of the storage backend used by bitcoin-ruby-blockchain when creating this DB

blk

Block Headers

id integer Internal ID
hash bytea Block hash in binary
height integer Height in the blockchain
version bigint Protocol Version
prev_hash bytea Hash of the previous block this one builds on, in binary
mrkl_root bytea Root hash of the merkle tree of all transactions in this block, in binary
time bigint Block timestamp
bits bigint Compact Bits encoding the required difficulty target this blocks hash satisfies
nonce bigint Nonce used to make the block header yield the correct hash
blk_size integer Size of the block in bytes
chain integer Chain this block has been sorted into (0 = main, 1 = side, 2 = orphan)
work bytea The total amount of work that has been done on the chain (including this block)
aux_pow bytea Auxiliary Proof-of-Work for merge-mined (Namecoin) blocks

blk_tx

Mapping between Blocks and Transactions

blk_id integer Block ID
tx_id integer Transaction ID
idx integer Index of the transaction inside the block

tx

Transactions

id integer Internal ID
hash bytea Transaction hash, in binary
version bigint Protocol Version
lock_time bigint Timestamp/Block Height before which the transaction isn't valid
coinbase boolean Whether this is a coinbase transaction
tx_size integer Size of the transaction in bytes
nhash bytea Normalized Hash of the transaction

txin

Transaction Inputs

id integer Internal ID
tx_id integer Transaction ID
tx_idx integer Index of this input inside the transaction
prev_out bytea Hash of the previous output transaction this input references
prev_out_index bigint Index of the output in the previous transaction
sequence bigint Transaction Sequence
script_sig bytea The Signature Script providing the signatures to satisfy the previous output script
p2sh_type integer Type of the inner script in case of a p2sh output

txouts

Transaction Outputs

id integer Internal ID
tx_id integer Transaction ID
tx_idx integer Index of this output inside the transaction
pk_script bytea The Output Script defining the recipient of the coins
value bigint Output value (in satoshi)
type integer Type of the output script (0=unknown, 1=pubkey, 2=pubkey_hash(address), 3=multisig, 4=script_hash(p2sh), 5=op_return, 6=name_new, 7=name_firstupdate, 8=name_update)

addr_txout

Mapping between Addresses and Transaction Outputs

addr_id integer Address ID
txout_id integer Output ID

addr

Addresses

id integer Internal ID
hash160 text Hash160 of the address
type integer Type of the address (0 = regular, 1 = p2sh)

names

Namecoin Name Records

txout_id integer Internal ID
hash bytea Name-Hash of this name, in binary
name bytea The Name that is registered
value bytea The Value associated with this Name