PandaCoin's are minted by miners who earn a reward of 50 bamboo per block. Mining payments occur up until block 2,000,000 after which miners are compensated purely through transaction fees. This means the total circulation of the currency is limited to 100,000,000 Bamboo.
PandaCoin is written from the ground up in C++. We want the PandaCoin source code to be simple, elegant, and easy to understand. Rather than adding duct-tape to an existing currency, we built PandaCoin from scratch with lots of love. There are a few optimizations that we have made to help further our core objectives:
- Switched encryption scheme from secp256k1 (which is used by ETH & BTC) to ED25519 -- results in 8x speedup during verification and public keys half the size.
- Transactions are created uniquely to each blockID
- Can queue transactions to execute up to 10 blocks in the future.
- 5000 transactions per block, 30 second block time
- Measured transactions per second > 400TPS
GET: /block_count
: Returns the number of blocks in the current chainGET: /stats
: Statistics on current chain in JSON formatGET: /block/<int:blockId>
: Block information in JSON formatGET: /ledger/<string:walletAddress>
: The balance for the specified wallet in JSON formatGET: /mine
: Returns the last block hash and difficulty in JSON formatGET: /sync/<int:startId>/<int:endId>
: Returns binary serialized blocks within rangeGET: /synctx
: Returns binary serialized transactions in mem poolPOST: /submit
: Submits a new block (data must be binary serialized)POST: /add_transaction
: Submits a new transaction (data must be binary serialized).
struct BlockHeader {
int id;
time_t timestamp;
int difficulty;
int numTransactions;
char merkleRoot[32];
char nonce[32];
};
struct TransactionInfo {
int blockId;
char signature[64];
char signingKey[32];
time_t timestamp;
char nonce[8];
char to[25];
char from[25];
long amount;
long fee;
bool isTransactionFee;
};
Requires:
- CMake
- Conan package manager (http://www.conan.io)
- LevelDB
git clone https://github.com/mr-pandabear/panda-coin.git
cd panda-coin
git checkout stable
mkdir build
cd build
conan install ..
cd ..
cmake .
To compile the miner run the following command:
make miner
You will also need the keygen app to create a wallet for your miner:
make keygen
To compile the node server:
make server
Start by generating keys.json
. Keep a copy of this file -- it contains pub/private keys to the wallet that the miner will mint coins to.
./bin/keygen
To start mining:
./bin/miner
To host a node:
./bin/server