This is just a rough draft, there is much more to be added.
To see the rest of the documentation for the Drivechain project: https://github.com/drivechain-project/docs
https://github.com/drivechain-project/bitcoin/tree/mainchainBMM
The mainchain is Bitcoin, with added functionality to support Drivechains. The work that is intended to be merged upstream all goes into the mainchain branch of the Bitcoin fork in this repository.
https://github.com/drivechain-project/bitcoin/tree/sidechainBMM
The sidechain is a fork of Bitcoin, with added functionality to support the sidechain half of Drivechains. This code doesn't ever need to be merged into Bitcoin upstream.
'BMM' stands for blind merged mining which is how Drivechains use the PoW of the Bitcoin mainchain. Refer to http://www.truthcoin.info/blog/blind-merged-mining/ for more information.
SCDB
is short for Sidechain Database. The SCDB keeps track of the work score
of WT^(s) for each sidechain during the current verification period as well as BMM linking data.
wt
is the name given to an individual withdrawal attempt from the sidechain back to the mainchain.
WT^
is the name given to a transaction created by the sidechain that joins pending wt's
into a single transaction that can be verified by the mainchain.
B-WT^
is the blinded version (no inputs) of a WT^ that is voted on. Once a B-WT^ has
sufficient workscore the WT^ with inputs will be created. The WT^ can be verified by
blinding it again.
createcriticaldatatx
Create a critical data transaction
Arguments:
1. "amount" (numeric or string, required) The amount in BTC to be spent.
2. "height" (numeric, required) The block height this transaction must be included in.
3. "criticalhash" (string, required) h* you want added to a coinbase
Examples:
> bitcoin-cli createcriticaldatatx "amount", "height", "criticalhash"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createcriticaldatatx", "params": ["amount", "height", "criticalhash"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
(code -1)
listsidechaindeposits
Called by sidechain, return list of deposits
Arguments:
1. "nsidechain" (numeric, required) The sidechain number
Examples:
> bitcoin-cli listsidechaindeposits "nsidechain"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listsidechaindeposits", "params": ["nsidechain"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
(code -1)
receivewtprime
Called by sidechain to announce new WT^ for verification
Arguments:
1. "nsidechain" (int, required) The sidechain number
2. "rawtx" (string, required) The raw transaction hex
Examples:
> bitcoin-cli receivewtprime
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "receivewtprime", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
(code -1)
receivewtprimeupdate
Receive an update for a WT^
Arguments:
1. "height" (numeric, required) the block height
2. "updates" (array, required) A json array of json objects
[
{
"sidechainnumber":n, (numeric, required) The sidechain number
"hashWTPrime":id, (string, required) The WT^ hash
"workscore":n (numeric, required) The updated workscore
}
,...
]
Examples:
> bitcoin-cli receivewtprimeupdate
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "receivewtprimeupdate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
(code -1)
receivewtprimeupdate 10 '[{"sidechainnumber": '1', "hashWTPrime": "'3366e8825f6c0d6da7c870c1ab6b035e1ef1610a6d1e7d7afb972a169c4c648a'", "workscore": '1'}]'
Each sidechain is assigned a unique number, represented by an 8 bit unsigned integer. This limits the maximum number of sidechains to 256.
Please see https://github.com/drivechain-project/bitcoin/issues and submit any new issues that you discover.
http://www.drivechain.info/literature/index.html
https://github.com/drivechain-project/
https://bitcoin-hivemind.herokuapp.com/ (sidechains discussion slack channel)
Follow Paul Sztorc on Twitter.
Join the IRC channel -- #drivechain-dev on freenode.