Skip to content

Getting Started

ClassicBitcoins edited this page Mar 19, 2019 · 14 revisions

ClassicBitcoin User Guide - Getting Started

Welcome! This guide is intended to get you running on the official ClassicBitcoin network. ClassicBitcoin currently has some limitations: it only officially supports Linux, requires 64-bit, and in some situations requires heavy memory and CPU consumption to create transactions.

Please let us know if you run into snags.

Upgrading?

If you are upgrading from one of our previous releases, you can update your local snapshot of our code: Other information on the zHardFork on february 2019 and to apply for a swap. (only for coins received after block 536000 on old blockchain) Please visit ... SWAP Page.

$ git fetch origin
git checkout master
make clean
./cbtcutil/fetch-params.sh
./cbtcutil/build.sh -j$(nproc)

A quick note about terminology

ClassicBitcoin supports two different kinds of addresses, a z-addr (which begins with a z) is an address that uses zero-knowledge proofs and other cryptography to protect user privacy. There are also r-addrs (which begin with a r) that are similar to Bitcoin's addresses. Requirements

Currently, you will need:

  • Linux (easiest with a Debian-based distribution)
  • 64-bit
  • 4GB of free memory

    The interfaces are a commandline client (cbtc-cli) and a Remote Procedure Call (RPC) interface, which is documented here:

    https://github.com/classicbitcoins/cbitcoin/blob/master/doc/payment-api.md Security

    Before installing, upgrading, or running ClassicBitcoin, ensure you have checked for any security issues. Please See our Security page:

    https://bitclassic.info/support/security.html Get started

    On Ubuntu/Debian-based systems:

    $ sudo apt-get update && sudo apt-get install \
          build-essential pkg-config libc6-dev m4 g++-multilib \
          autoconf libtool ncurses-dev unzip git python \
          zlib1g-dev wget bsdmainutils automake 

    On Fedora-based systems:

    $ sudo dnf install \
          git pkgconfig automake autoconf ncurses-devel python wget \
          gtest-devel gcc gcc-c++ libtool patch

    Fetch our repository with git and run fetch-params.sh like so:

    $ git clone https://github.com/classicbitcoins/cbitcoin.git
    $ cd cbitcoin/
    $ git checkout master
    $ ./cbtcutil/fetch-params.sh

    This will fetch our Sprout proving and verifying keys (the final ones created in the Parameter Generation Ceremony), and place them into ~/.zcash-params/. These keys are just under 911MB in size, so it may take some time to download them. Compiling

    Ensure you have successfully installed all system package dependencies as described above. Then run the build, e.g.:

    $ ./cbtcutil/build.sh -j$(nproc)
    This should compile our dependencies and build cbtcd. (Note: if you don't have nproc, then substitute the number of your processors.) Configuration

    Create the ~/.cbitcoin directory and place a configuration file at ~/.cbitcoin/cbitcoin.conf using the following commands:

    mkdir -p ~/.cbitcoin
    echo "addnode=dnsseed.bitclassic.info" > ~/.cbitcoin/cbitcoin.conf
    echo "addnode=dnsseed.rotorproject.org" >> ~/.cbitcoin/cbitcoin.conf
    echo "rpcuser=username" >> ~/.cbitcoin/cbitcoin.conf
    echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >> ~/.cbitcoin/cbitcoin.conf

    Note that this will overwrite any cbitcoin.conf settings you may have added previously. We strongly recommend that you use a random password to avoid potential security issues with access to the RPC interface. Enabling CPU mining:

    If you want to enable CPU mining, run these commands:

    $ echo 'gen=1' >> ~/.cbitcoin/cbitcoin.conf
    $ echo "genproclimit=$(nproc)" >> ~/.cbitcoin/cbitcoin.conf

    The default miner is not efficient, but has been well reviewed. To use a much more efficient but unreviewed solver, you can run this command:

    $ echo 'equihashsolver=tromp' >> ~/.cbitcoin/cbitcoin.conf

    Running CBTC:

    Now, run cbtcd!

    $ ./src/cbtcd

    To run it in the background (without the node metrics screen that is normally displayed) use ./src/cbtcd --daemon.

    NOTE: If you would like to support the ClassicBitcoin network you can run a full node with ./src/cbtcd -txindex, this will maintain a full transaction index. Note that if you were previously synced to the network you will have to rebuild the blockchain index once with

    $ ./src/cbtcd -txindex -reindex.

    NOTE: If you are behind a firewall/NAT you will have to open/map TCP Port 7123 so that other peers are able to establish incoming connections.

    You should be able to use the RPC interface after it finishes loading. Here's a quick way to test:

    $ ./src/cbtc-cli getinfo

    NOTE: If you are familiar with bitcoind's RPC interface, you can use many of those calls to send ZCL between t-addr addresses. We do not support the 'Accounts' feature (which has also been deprecated in bitcoind) — only the empty string "" can be used as an account name.

    To see the peers you are connected to:

    $ ./src/cbtc-cli getpeerinfo

    Using ClassicBitcoin

    First, you want to obtain CBTC. You can purchase them from an exchange, from other users, or sell goods and services for them! Exactly how to obtain CBTC (safely) is not in scope for this document, but you should be careful. Avoid scams!

    Generating a r-addr

    Let's generate a r-addr first.

    $ ./src/cbtc-cli getnewaddress
    tb4oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1

    Receiving CBTC with a z-addr

    Now let's generate a z-addr.

    $ ./src/cbtc-cli z_getnewaddress
    ztbqWB8VDjVER7uLKb4oHp2v54v2a1jKd9o4FY7mdgQ3gDfG8MiZLvdQga8JK3t58yjXGjQHzMzkGUxSguSs6ZzqpgTNiZG

    This creates a private address and stores its key in your local wallet file. Give this address to the sender!

    A z-addr is pretty large, so it's easy to make mistakes with them. Let's put it in an environment variable to avoid mistakes:

    $ ZADDR='ztbqWB8VDjVER7uLKb4oHp2v54v2a1jKd9o4FY7mdgQ3gDfG8MiZLvdQga8JK3t58yjXGjQHzMzkGUxSguSs6ZzqpgTNiZG`

    To get a list of all addresses in your wallet for which you have a spending key, run this command:

    $ ./src/cbtc-cli z_listaddresses

    You should see something like:

    [ "zta6qngiR3U7HxYopyTWkaDLwYBd83D5MT7Jb9gpgTzPLMZytzRbtdPP1Syv4RvRgHeoZrJWSask3DyfwXG9DGPMWMvX7aC", "ztbqWB8VDjVER7uLKb4oHp2v54v2a1jKd9o4FY7mdgQ3gDfG8MiZLvdQga8JK3t58yjXGjQHzMzkGUxSguSs6ZzqpgTNiZG" ]

    Great! Now, send your z-addr to the sender. You should eventually see their transaction when checking:

    $ ./src/cbtc-cli z_listreceivedbyaddress "$ZADDR"
    

    [ { "txid" : "af1665b317abe538148114a45322f28151925501c081949cc7a5207ef21cb750", "amount" : 1.23, "memo" : "48656c6c6f20ceb2210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" } ]

    Sending coins with your z-addr

    If someone gives you their z-addr...

    $ FRIEND='ztcDe8krwEt1ozWmGZhBDWrcUfmK3Ue5D5z1f6u2EZLLCjQq7mBRkaAPb45FUH4Tca91rF4R1vf983ukR71kHyXeED4quGV'

    You can send 0.8 CBTC by doing...

    $ ./src/cbtc-cli z_sendmany "$ZADDR" "[{\"amount\": 0.8, \"address\": \"$FRIEND\"}]"

    After waiting about a minute, you can check to see if the operation has finished and produced a result:

    $ ./src/cbtc-cli z_getoperationresult

    [ { "id" : "opid-4eafcaf3-b028-40e0-9c29-137da5612f63", "status" : "success", "creation_time" : 1473439760, "result" : { "txid" : "3b85cab48629713cc0caae99a49557d7b906c52a4ade97b944f57b81d9b0852d" }, "execution_secs" : 51.64785629 } ]

    Known Security Issues

    Each release contains a ./doc/security-warnings.md document describing security issues known to affect that release. You can find the most recent version of this document here:

  • You can’t perform that action at this time.