From ece30654a8470e7481ee9842642b9be517115a74 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 4 Oct 2016 23:07:13 -0500 Subject: [PATCH 001/104] Update release process to sign release tags --- doc/release-process.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/release-process.md b/doc/release-process.md index 027a5db5..2fe3b556 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -76,15 +76,13 @@ https://ci.z.cash/builders/depends-sources Run `./fetch-params.sh`. -## D. make tags / release-branch for the newly merged result +## D. make tag for the newly merged result -In this example, we ensure zc.v0.11.2.latest is up to date with the +In this example, we ensure master is up to date with the previous merged PR, then: - $ git tag v${ZCASH_RELEASE} - $ git branch zc.v${ZCASH_RELEASE} + $ git tag -s v${ZCASH_RELEASE} $ git push origin v${ZCASH_RELEASE} - $ git push origin zc.v${ZCASH_RELEASE} ## E. deploy testnet @@ -104,8 +102,6 @@ Zcash still needs: * deterministic or reproducible builds -* signed git tags - * thorough pre-release testing (presumably more thorough than standard PR tests) * release deployment steps (eg: updating build-depends mirror, deploying testnet, etc...) From 6216b4b2dc1f5d34fbcc88f2a3902530dfae0e88 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 5 Oct 2016 09:49:43 -0500 Subject: [PATCH 002/104] WriteWitnessCache: Catch errors and abort transaction Closes #1456 --- src/wallet/wallet.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 87deb024..fea1c048 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -730,15 +730,23 @@ void CWallet::WriteWitnessCache() { LogPrintf("WriteWitnessCache(): Couldn't start atomic write\n"); return; } - for (std::pair& wtxItem : mapWallet) { - if (!walletdb.WriteTx(wtxItem.first, wtxItem.second)) { - LogPrintf("WriteWitnessCache(): Failed to write CWalletTx, aborting atomic write\n"); + try { + for (std::pair& wtxItem : mapWallet) { + if (!walletdb.WriteTx(wtxItem.first, wtxItem.second)) { + LogPrintf("WriteWitnessCache(): Failed to write CWalletTx, aborting atomic write\n"); + walletdb.TxnAbort(); + return; + } + } + if (!walletdb.WriteWitnessCacheSize(nWitnessCacheSize)) { + LogPrintf("WriteWitnessCache(): Failed to write nWitnessCacheSize, aborting atomic write\n"); walletdb.TxnAbort(); return; } - } - if (!walletdb.WriteWitnessCacheSize(nWitnessCacheSize)) { - LogPrintf("WriteWitnessCache(): Failed to write nWitnessCacheSize, aborting atomic write\n"); + } catch (const std::exception &exc) { + // Unexpected failure + LogPrintf("WriteWitnessCache(): Unexpected error during atomic write:\n"); + LogPrintf("%s\n", exc.what()); walletdb.TxnAbort(); return; } From 3c31eb24d332c403f12c766499a201246806734f Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 5 Oct 2016 15:16:47 -0500 Subject: [PATCH 003/104] Throw an RPC error for all accounts except the default --- src/rpcprotocol.h | 2 +- src/wallet/rpcwallet.cpp | 33 ++++++++++++++------------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 4f3f70fb..473b8d11 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -69,7 +69,7 @@ enum RPCErrorCode //! Wallet errors RPC_WALLET_ERROR = -4, //! Unspecified problem with wallet (key not found etc.) RPC_WALLET_INSUFFICIENT_FUNDS = -6, //! Not enough funds in wallet or account - RPC_WALLET_INVALID_ACCOUNT_NAME = -11, //! Invalid account name + RPC_WALLET_ACCOUNTS_DEPRECATED = -11, //! Accounts are deprecated RPC_WALLET_KEYPOOL_RAN_OUT = -12, //! Keypool ran out, call keypoolrefill first RPC_WALLET_UNLOCK_NEEDED = -13, //! Enter the wallet passphrase with walletpassphrase first RPC_WALLET_PASSPHRASE_INCORRECT = -14, //! The wallet passphrase entered was incorrect diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 4bf5606a..1239edd2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -97,8 +97,8 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) string AccountFromValue(const Value& value) { string strAccount = value.get_str(); - if (strAccount == "*") - throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, "Invalid account name"); + if (strAccount != "") + throw JSONRPCError(RPC_WALLET_ACCOUNTS_DEPRECATED, "Accounts are deprecated"); return strAccount; } @@ -111,10 +111,8 @@ Value getnewaddress(const Array& params, bool fHelp) throw runtime_error( "getnewaddress ( \"account\" )\n" "\nReturns a new Bitcoin address for receiving payments.\n" - "If 'account' is specified (DEPRECATED), it is added to the address book \n" - "so payments received with the address will be credited to 'account'.\n" "\nArguments:\n" - "1. \"account\" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.\n" + "1. \"account\" (string, optional) DEPRECATED. If provided, it MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "\nResult:\n" "\"bitcoinaddress\" (string) The new bitcoin address\n" "\nExamples:\n" @@ -191,7 +189,7 @@ Value getaccountaddress(const Array& params, bool fHelp) "getaccountaddress \"account\"\n" "\nDEPRECATED. Returns the current Bitcoin address for receiving payments to this account.\n" "\nArguments:\n" - "1. \"account\" (string, required) The account name for the address. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.\n" + "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "\nResult:\n" "\"bitcoinaddress\" (string) The account bitcoin address\n" "\nExamples:\n" @@ -259,7 +257,7 @@ Value setaccount(const Array& params, bool fHelp) "\nDEPRECATED. Sets the account associated with the given address.\n" "\nArguments:\n" "1. \"bitcoinaddress\" (string, required) The bitcoin address to be associated with an account.\n" - "2. \"account\" (string, required) The account to assign the address to.\n" + "2. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "\nExamples:\n" + HelpExampleCli("setaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\" \"tabby\"") + HelpExampleRpc("setaccount", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\", \"tabby\"") @@ -336,7 +334,7 @@ Value getaddressesbyaccount(const Array& params, bool fHelp) "getaddressesbyaccount \"account\"\n" "\nDEPRECATED. Returns the list of addresses for the given account.\n" "\nArguments:\n" - "1. \"account\" (string, required) The account name.\n" + "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "\nResult:\n" "[ (json array of string)\n" " \"bitcoinaddress\" (string) a bitcoin address associated with the given account\n" @@ -625,7 +623,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp) "getreceivedbyaccount \"account\" ( minconf )\n" "\nDEPRECATED. Returns the total amount received by addresses with in transactions with at least [minconf] confirmations.\n" "\nArguments:\n" - "1. \"account\" (string, required) The selected account, may be the default account using \"\".\n" + "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" "\nResult:\n" "amount (numeric) The total amount in btc received for this account.\n" @@ -712,12 +710,9 @@ Value getbalance(const Array& params, bool fHelp) if (fHelp || params.size() > 3) throw runtime_error( "getbalance ( \"account\" minconf includeWatchonly )\n" - "\nIf account is not specified, returns the server's total available balance.\n" - "If account is specified (DEPRECATED), returns the balance in the account.\n" - "Note that the account \"\" is not the same as leaving the parameter out.\n" - "The server total may be different to the balance in the default \"\" account.\n" + "\nReturns the server's total available balance.\n" "\nArguments:\n" - "1. \"account\" (string, optional) DEPRECATED. The selected account, or \"*\" for entire wallet. It may be the default account using \"\".\n" + "1. \"account\" (string, optional) DEPRECATED. If provided, it MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" "3. includeWatchonly (bool, optional, default=false) Also include balance in watchonly addresses (see 'importaddress')\n" "\nResult:\n" @@ -805,8 +800,8 @@ Value movecmd(const Array& params, bool fHelp) "move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n" "\nDEPRECATED. Move a specified amount from one account in your wallet to another.\n" "\nArguments:\n" - "1. \"fromaccount\" (string, required) The name of the account to move funds from. May be the default account using \"\".\n" - "2. \"toaccount\" (string, required) The name of the account to move funds to. May be the default account using \"\".\n" + "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" + "2. \"toaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "3. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n" "4. \"comment\" (string, optional) An optional comment, stored in the wallet only.\n" "\nResult:\n" @@ -877,7 +872,7 @@ Value sendfrom(const Array& params, bool fHelp) "The amount is a real and is rounded to the nearest 0.00000001." + HelpRequiringPassphrase() + "\n" "\nArguments:\n" - "1. \"fromaccount\" (string, required) The name of the account to send funds from. May be the default account using \"\".\n" + "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "2. \"tobitcoinaddress\" (string, required) The bitcoin address to send funds to.\n" "3. amount (numeric, required) The amount in btc. (transaction fee is added on top).\n" "4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n" @@ -939,7 +934,7 @@ Value sendmany(const Array& params, bool fHelp) "\nSend multiple times. Amounts are double-precision floating point numbers." + HelpRequiringPassphrase() + "\n" "\nArguments:\n" - "1. \"fromaccount\" (string, required) DEPRECATED. The account to send the funds from. Should be \"\" for the default account\n" + "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "2. \"amounts\" (string, required) A json object with addresses and amounts\n" " {\n" " \"address\":amount (numeric) The bitcoin address is the key, the numeric amount in btc is the value\n" @@ -1056,7 +1051,7 @@ Value addmultisigaddress(const Array& params, bool fHelp) " \"address\" (string) bitcoin address or hex-encoded public key\n" " ...,\n" " ]\n" - "3. \"account\" (string, optional) DEPRECATED. An account to assign the addresses to.\n" + "3. \"account\" (string, optional) DEPRECATED. If provided, MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" "\nResult:\n" "\"bitcoinaddress\" (string) A bitcoin address associated with the keys.\n" From e9c7cf32987d3da860d3c551513dadb39cc1b051 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Thu, 6 Oct 2016 17:32:39 -0700 Subject: [PATCH 004/104] Document wallet reindexing for z_importkey description in payment-api.md --- doc/payment-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/payment-api.md b/doc/payment-api.md index 71c069ae..3245a403 100644 --- a/doc/payment-api.md +++ b/doc/payment-api.md @@ -63,7 +63,7 @@ z_listaddresses | | Returns a list of all the zaddrs in this node’s wallet for Command | Parameters | Description --- | --- | --- z_exportkey | zaddr | _Requires an unlocked wallet or an unencrypted wallet._

Return a zkey for a given zaddr belonging to the node’s wallet.

The key will be returned as a string formatted using Base58Check as described in the Zcash protocol spec.

Output:AKWUAkypwQjhZ6LLNaMuuuLcmZ6gt5UFyo8m3jGutvALmwZKLdR5 -z_importkey | zkey [rescan=true] | _Wallet must be unlocked._

Add a zkey as returned by z_exportkey to a node's wallet.

The key should be formatted using Base58Check as described in the Zcash protocol spec.

Set rescan to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transactions affecting the newly-added address for this spending key). +z_importkey | zkey [rescan=true] | _Wallet must be unlocked._

Add a zkey as returned by z_exportkey to a node's wallet.

The key should be formatted using Base58Check as described in the Zcash protocol spec.

Set rescan to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transactions affecting the newly-added address for this spending key).

**NOTE:** If funds for imported keys fail to display, try stopping the node and restarting it with a `-reindex` flag. (`./src/zcashd -reindex`) z_exportwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._

Creates or overwrites a file with taddr private keys and zaddr private keys in a human-readable format.

Filename is the file in which the wallet dump will be placed. May be prefaced by an absolute file path. An existing file with that name will be overwritten.

No value is returned but a JSON-RPC error will be reported if a failure occurred. z_importwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._

Imports private keys from a file in wallet export file format (see z_exportwallet). These keys will be added to the keys currently in the wallet. This call may need to rescan all or parts of the block chain for transactions affecting the newly-added keys, which may take several minutes.

Filename is the file to import. The path is relative to zcashd’s working directory.

No value is returned but a JSON-RPC error will be reported if a failure occurred. From f7cfb52d3cb24aa4c101ac2f8dde33bb6c394f1b Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 6 Oct 2016 18:55:14 -0700 Subject: [PATCH 005/104] Add vjoinsplit to JSON output of RPC call gettransaction --- qa/rpc-tests/wallet.py | 11 +++++- src/rpcrawtransaction.cpp | 73 +++++++++++++++++++++------------------ src/wallet/rpcwallet.cpp | 15 ++++++++ 3 files changed, 64 insertions(+), 35 deletions(-) diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 7f9541fb..e4822c2f 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -225,13 +225,17 @@ class WalletTest (BitcoinTestFramework): # send from node 0 to node 2 taddr mytaddr = self.nodes[2].getnewaddress(); - self.nodes[0].sendtoaddress(mytaddr, 10.0); + mytxid = self.nodes[0].sendtoaddress(mytaddr, 10.0); self.nodes[0].generate(1) self.sync_all() mybalance = self.nodes[2].z_getbalance(mytaddr) assert_equal(self.nodes[2].z_getbalance(mytaddr), Decimal('10.0')); + mytxdetails = self.nodes[2].gettransaction(mytxid) + myvjoinsplits = mytxdetails["vjoinsplit"] + assert_equal(0, len(myvjoinsplits)) + # add zaddr to node 2 myzaddr = self.nodes[2].z_getnewaddress() @@ -251,6 +255,7 @@ class WalletTest (BitcoinTestFramework): sleep(1) else: status = results[0]["status"] + mytxid = results[0]["result"]["txid"] break assert_equal("success", status) @@ -274,6 +279,10 @@ class WalletTest (BitcoinTestFramework): assert_equal(Decimal(resp["private"]), zsendmanynotevalue) assert_equal(Decimal(resp["total"]), node2utxobalance + zsendmanynotevalue) + # there should be at least one joinsplit + mytxdetails = self.nodes[2].gettransaction(mytxid) + myvjoinsplits = mytxdetails["vjoinsplit"] + assert_greater_than(len(myvjoinsplits), 0) # send from private note to node 0 and node 2 node0balance = self.nodes[0].getbalance() # 25.99794745 diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index a5d74f22..5cca9df9 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -55,41 +55,8 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeH out.push_back(Pair("addresses", a)); } -void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) -{ - entry.push_back(Pair("txid", tx.GetHash().GetHex())); - entry.push_back(Pair("version", tx.nVersion)); - entry.push_back(Pair("locktime", (int64_t)tx.nLockTime)); - Array vin; - BOOST_FOREACH(const CTxIn& txin, tx.vin) { - Object in; - if (tx.IsCoinBase()) - in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); - else { - in.push_back(Pair("txid", txin.prevout.hash.GetHex())); - in.push_back(Pair("vout", (int64_t)txin.prevout.n)); - Object o; - o.push_back(Pair("asm", txin.scriptSig.ToString())); - o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); - in.push_back(Pair("scriptSig", o)); - } - in.push_back(Pair("sequence", (int64_t)txin.nSequence)); - vin.push_back(in); - } - entry.push_back(Pair("vin", vin)); - Array vout; - for (unsigned int i = 0; i < tx.vout.size(); i++) { - const CTxOut& txout = tx.vout[i]; - Object out; - out.push_back(Pair("value", ValueFromAmount(txout.nValue))); - out.push_back(Pair("n", (int64_t)i)); - Object o; - ScriptPubKeyToJSON(txout.scriptPubKey, o, true); - out.push_back(Pair("scriptPubKey", o)); - vout.push_back(out); - } - entry.push_back(Pair("vout", vout)); +Array TxJoinSplitToJSON(const CTransaction& tx) { Array vjoinsplit; for (unsigned int i = 0; i < tx.vjoinsplit.size(); i++) { const JSDescription& jsdescription = tx.vjoinsplit[i]; @@ -126,7 +93,45 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) vjoinsplit.push_back(joinsplit); } + return vjoinsplit; +} +void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) +{ + entry.push_back(Pair("txid", tx.GetHash().GetHex())); + entry.push_back(Pair("version", tx.nVersion)); + entry.push_back(Pair("locktime", (int64_t)tx.nLockTime)); + Array vin; + BOOST_FOREACH(const CTxIn& txin, tx.vin) { + Object in; + if (tx.IsCoinBase()) + in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); + else { + in.push_back(Pair("txid", txin.prevout.hash.GetHex())); + in.push_back(Pair("vout", (int64_t)txin.prevout.n)); + Object o; + o.push_back(Pair("asm", txin.scriptSig.ToString())); + o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); + in.push_back(Pair("scriptSig", o)); + } + in.push_back(Pair("sequence", (int64_t)txin.nSequence)); + vin.push_back(in); + } + entry.push_back(Pair("vin", vin)); + Array vout; + for (unsigned int i = 0; i < tx.vout.size(); i++) { + const CTxOut& txout = tx.vout[i]; + Object out; + out.push_back(Pair("value", ValueFromAmount(txout.nValue))); + out.push_back(Pair("n", (int64_t)i)); + Object o; + ScriptPubKeyToJSON(txout.scriptPubKey, o, true); + out.push_back(Pair("scriptPubKey", o)); + vout.push_back(out); + } + entry.push_back(Pair("vout", vout)); + + Array vjoinsplit = TxJoinSplitToJSON(tx); entry.push_back(Pair("vjoinsplit", vjoinsplit)); if (!hashBlock.IsNull()) { diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 4bf5606a..ab75ffb5 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -39,6 +39,8 @@ using namespace json_spirit; using namespace libzcash; +extern Array TxJoinSplitToJSON(const CTransaction& tx); + int64_t nWalletUnlockTime; static CCriticalSection cs_nWalletUnlockTime; @@ -92,6 +94,8 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived)); BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue) entry.push_back(Pair(item.first, item.second)); + + entry.push_back(Pair("vjoinsplit", TxJoinSplitToJSON(wtx))); } string AccountFromValue(const Value& value) @@ -1702,6 +1706,17 @@ Value gettransaction(const Array& params, bool fHelp) " }\n" " ,...\n" " ],\n" + " \"vjoinsplit\" : [\n" + " {\n" + " \"anchor\" : \"treestateref\", (string) Merkle root of note commitment tree\n" + " \"nullifiers\" : [ string, ... ] (string) Nullifiers of input notes\n" + " \"commitments\" : [ string, ... ] (string) Note commitments for note outputs\n" + " \"macs\" : [ string, ... ] (string) Message authentication tags\n" + " \"vpub_old\" : x.xxx (numeric) The amount removed from the transparent value pool\n" + " \"vpub_new\" : x.xxx, (numeric) The amount added to the transparent value pool\n" + " }\n" + " ,...\n" + " ],\n" " \"hex\" : \"data\" (string) Raw data for transaction\n" "}\n" From 5b834670d39ae704b93cc818971b6d3d8878090e Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 7 Oct 2016 08:56:29 -0700 Subject: [PATCH 006/104] Rm beta 1 release note about encrypted wallets --- doc/payment-api.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/payment-api.md b/doc/payment-api.md index 3245a403..6fb7d4ca 100644 --- a/doc/payment-api.md +++ b/doc/payment-api.md @@ -58,8 +58,6 @@ z_listaddresses | | Returns a list of all the zaddrs in this node’s wallet for ### Key Management -**beta 1 release note:** encrypted wallets are not yet fully supported. If the wallet is protected with a passphrase, zkeys will not be persisted to disk. - Command | Parameters | Description --- | --- | --- z_exportkey | zaddr | _Requires an unlocked wallet or an unencrypted wallet._

Return a zkey for a given zaddr belonging to the node’s wallet.

The key will be returned as a string formatted using Base58Check as described in the Zcash protocol spec.

Output:AKWUAkypwQjhZ6LLNaMuuuLcmZ6gt5UFyo8m3jGutvALmwZKLdR5 From dd8e398be144d5d648113e221e3f98a9c5318270 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 7 Oct 2016 15:23:02 -0700 Subject: [PATCH 007/104] Note that Coinbase maturity interval does not protect JoinSplits --- doc/security-warnings.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/security-warnings.md b/doc/security-warnings.md index 5b9ede69..ab0311d9 100644 --- a/doc/security-warnings.md +++ b/doc/security-warnings.md @@ -44,9 +44,9 @@ The REST interface is a feature inherited from upstream Bitcoin. By default, it is disabled. We do not recommend you enable it until it has undergone a security review. -Block Chain Reorganizations ----------------------------- +Block Chain Reorganization: Major Differences +--------------------------------------------------- -Users should be aware of new behavior in Zcash that differs significantly from Bitcoin: in the case of a block chain reorganization, Bitcoin's coinbase maturity rule helps ensure that any reorg shorter than the maturity interval will not invalidate any of the rolled-back transactions. However for Zcash, all JoinSplits which were anchored within the reorg interval will become invalid, rolling back transactions and reverting funds to the original owner. The transaction rebroadcast mechanism inherited from Bitcoin will not successfully rebroadcast transactions containing JoinSplits if the anchor needs to change—the JoinSplit creator must do that. +Users should be aware of new behavior in Zcash that differs significantly from Bitcoin: in the case of a block chain reorganization, Bitcoin's coinbase maturity rule helps ensure that any reorg shorter than the maturity interval will not invalidate any of the rolled-back transactions. Zcash keeps Bitcoin's 100 block maturity lapse for generation transactions, but because JoinSplits must be anchored within a block, the protections this provides are much more limited in scope. In the case of a block chain reorg for Zcash, all JoinSplits which were anchored within the reorg interval and any transactions that depend on them will become invalid, rolling back transactions and reverting funds to the original owner. The transaction rebroadcast mechanism inherited from Bitcoin will not successfully rebroadcast transactions depending on invalidated JoinSplits if the anchor needs to change. The creator of an invalidated JoinSplit, as well as the creators of all transactions dependent on it, must rebroadcast the transactions themselves. -For receivers of funds from a JoinSplit, using a higher minconf (minimum number of confirmations) can help mitigate the risk of relying on funds received from transactions that may be rolled back. +Receivers of funds from a JoinSplit can mitigate the risk of relying on funds received from transactions that may be rolled back by using a higher minconf (minimum number of confirmations). From b9f953aa1a750c5947e52a7230253e25803409ec Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 7 Oct 2016 16:17:08 -0700 Subject: [PATCH 008/104] Refer to Zcash wiki in INSTALL --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 18626e17..647c89a3 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ Building Zcash -See doc/build-*.md for instructions on building zcashd, +See the Zcash github wiki (https://github.com/zcash/zcash/wiki) for instructions on building zcashd, the intended-for-services, no-graphical-interface, reference implementation of Zcash. From 83ea935339af0486b9cb04c48e4beeab7b92e7b2 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 7 Oct 2016 16:17:32 -0700 Subject: [PATCH 009/104] Rm bitcoin logo --- doc/bitcoin_logo_doxygen.png | Bin 3272 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 doc/bitcoin_logo_doxygen.png diff --git a/doc/bitcoin_logo_doxygen.png b/doc/bitcoin_logo_doxygen.png deleted file mode 100644 index 258be86edee2372033763742c513309761248f1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3272 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 Date: Fri, 7 Oct 2016 16:21:09 -0700 Subject: [PATCH 010/104] Rm build-unix.md, to keep single copy of build instructions for Zcash on github wiki --- doc/build-unix.md | 232 ---------------------------------------------- 1 file changed, 232 deletions(-) delete mode 100644 doc/build-unix.md diff --git a/doc/build-unix.md b/doc/build-unix.md deleted file mode 100644 index 21a8bc3c..00000000 --- a/doc/build-unix.md +++ /dev/null @@ -1,232 +0,0 @@ -*** Warning: This document has not been updated for Zcash and may be inaccurate. *** - -UNIX BUILD NOTES -==================== -Some notes on how to build Bitcoin in Unix. - -Note ---------------------- -Always use absolute paths to configure and compile bitcoin and the dependencies, -for example, when specifying the the path of the dependency: - - ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX - -Here BDB_PREFIX must absolute path - it is defined using $(pwd) which ensures -the usage of the absolute path. - -To Build ---------------------- - -```bash -./autogen.sh -./configure -make -make install # optional -``` - -This will build bitcoin-qt as well if the dependencies are met. - -Dependencies ---------------------- - -These dependencies are required: - - Library | Purpose | Description - ------------|------------------|---------------------- - libssl | SSL Support | Secure communications - libboost | Boost | C++ Library - -Optional dependencies: - - Library | Purpose | Description - ------------|------------------|---------------------- - miniupnpc | UPnP Support | Firewall-jumping support - libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled) - qt | GUI | GUI toolkit (only needed when GUI enabled) - protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when GUI enabled) - libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled) - -For the versions used in the release, see [release-process.md](release-process.md) under *Fetch and build inputs*. - -System requirements --------------------- - -C++ compilers are memory-hungry. It is recommended to have at least 1 GB of -memory available when compiling Bitcoin Core. With 512MB of memory or less -compilation will take much longer due to swap thrashing. - -Dependency Build Instructions: Ubuntu & Debian ----------------------------------------------- -Build requirements: - - sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev - -For Ubuntu 12.04 and later or Debian 7 and later libboost-all-dev has to be installed: - - sudo apt-get install libboost-all-dev - - db4.8 packages are available [here](https://launchpad.net/~bitcoin/+archive/bitcoin). - You can add the repository using the following command: - - sudo add-apt-repository ppa:bitcoin/bitcoin - sudo apt-get update - - Ubuntu 12.04 and later have packages for libdb5.1-dev and libdb5.1++-dev, - but using these will break binary wallet compatibility, and is not recommended. - -For other Debian & Ubuntu (with ppa): - - sudo apt-get install libdb4.8-dev libdb4.8++-dev - -Optional: - - sudo apt-get install libminiupnpc-dev (see --with-miniupnpc and --enable-upnp-default) - -Dependencies for the GUI: Ubuntu & Debian ------------------------------------------ - -If you want to build Bitcoin-Qt, make sure that the required packages for Qt development -are installed. Either Qt 4 or Qt 5 are necessary to build the GUI. -If both Qt 4 and Qt 5 are installed, Qt 4 will be used. Pass `--with-gui=qt5` to configure to choose Qt5. -To build without GUI pass `--without-gui`. - -To build with Qt 4 you need the following: - - sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler - -For Qt 5 you need the following: - - sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler - -libqrencode (optional) can be installed with: - - sudo apt-get install libqrencode-dev - -Once these are installed, they will be found by configure and a bitcoin-qt executable will be -built by default. - -Notes ------ -The release is built with GCC and then "strip bitcoind" to strip the debug -symbols, which reduces the executable size by about 90%. - - -miniupnpc ---------- - -[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here]( -http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and -turned off by default. See the configure options for upnp behavior desired: - - --without-miniupnpc No UPnP support miniupnp not required - --disable-upnp-default (the default) UPnP support turned off by default at runtime - --enable-upnp-default UPnP support turned on by default at runtime - -To build: - - tar -xzvf miniupnpc-1.6.tar.gz - cd miniupnpc-1.6 - make - sudo su - make install - - -Berkeley DB ------------ -It is recommended to use Berkeley DB 4.8. If you have to build it yourself: - -```bash -BITCOIN_ROOT=$(pwd) - -# Pick some path to install BDB to, here we create a directory within the bitcoin directory -BDB_PREFIX="${BITCOIN_ROOT}/db4" -mkdir -p $BDB_PREFIX - -# Fetch the source and verify that it is not tampered with -wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' -echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c -# -> db-4.8.30.NC.tar.gz: OK -tar -xzvf db-4.8.30.NC.tar.gz - -# Build the library and install to our prefix -cd db-4.8.30.NC/build_unix/ -# Note: Do a static build so that it can be embedded into the executable, instead of having to find a .so at runtime -../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX -make install - -# Configure Bitcoin Core to use our own-built instance of BDB -cd $BITCOIN_ROOT -./configure (other args...) LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" -``` - -**Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below). - -Boost ------ -If you need to build Boost yourself: - - sudo su - ./bootstrap.sh - ./bjam install - - -Security --------- -To help make your bitcoin installation more secure by making certain attacks impossible to -exploit even if a vulnerability is found, binaries are hardened by default. -This can be disabled with: - -Hardening Flags: - - ./configure --enable-hardening - ./configure --disable-hardening - - -Hardening enables the following features: - -* Position Independent Executable - Build position independent code to take advantage of Address Space Layout Randomization - offered by some kernels. Attackers who can cause execution of code at an arbitrary memory - location are thwarted if they don't know where anything useful is located. - The stack and heap are randomly located by default but this allows the code section to be - randomly located as well. - - On an AMD64 processor where a library was not compiled with -fPIC, this will cause an error - such as: "relocation R_X86_64_32 against `......' can not be used when making a shared object;" - - To test that you have built PIE executable, install scanelf, part of paxutils, and use: - - scanelf -e ./bitcoin - - The output should contain: - TYPE - ET_DYN - -* Non-executable Stack - If the stack is executable then trivial stack based buffer overflow exploits are possible if - vulnerable buffers are found. By default, bitcoin should be built with a non-executable stack - but if one of the libraries it uses asks for an executable stack or someone makes a mistake - and uses a compiler extension which requires an executable stack, it will silently build an - executable without the non-executable stack protection. - - To verify that the stack is non-executable after compiling use: - `scanelf -e ./bitcoin` - - the output should contain: - STK/REL/PTL - RW- R-- RW- - - The STK RW- means that the stack is readable and writeable but not executable. - -Disable-wallet mode --------------------- -When the intention is to run only a P2P node without a wallet, bitcoin may be compiled in -disable-wallet mode with: - - ./configure --disable-wallet - -In this case there is no dependency on Berkeley DB 4.8. - -Mining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC -call not `getwork`. - From 4902350d324f5f8dbc5636c4a6e3eb947f892e6c Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 7 Oct 2016 16:21:57 -0700 Subject: [PATCH 011/104] Rm Bitcoin-specific documentation --- doc/assets-attribution.md | 46 -------- doc/bips.md | 20 ---- doc/release-notes.md | 219 -------------------------------------- 3 files changed, 285 deletions(-) delete mode 100644 doc/assets-attribution.md delete mode 100644 doc/bips.md delete mode 100644 doc/release-notes.md diff --git a/doc/assets-attribution.md b/doc/assets-attribution.md deleted file mode 100644 index c6da1a45..00000000 --- a/doc/assets-attribution.md +++ /dev/null @@ -1,46 +0,0 @@ -The following is a list of assets used in the bitcoin source and their proper attribution. - -[Typicons/Stephen Hutchings](http://typicons.com) ------------------------ - -### Info -* Icon Pack: Typicons (http://typicons.com) -* Designer: Stephen Hutchings (and more) -* License: MIT -* Site: [https://github.com/stephenhutchings/typicons.font](https://github.com/stephenhutchings/typicons.font) - -### Assets Used - src/qt/res/icons/add.png, src/qt/res/icons/address-book.png, - src/qt/res/icons/configure.png, src/qt/res/icons/connect4.png, - src/qt/res/icons/debugwindow.png, src/qt/res/icons/edit.png, - src/qt/res/icons/exitcopy.png, src/qt/res/icons/editpaste.png, - src/qt/res/icons/export.png, src/qt/res/icons/eye.png, - src/qt/res/icons/filesave.png, src/qt/res/icons/history.png, - src/qt/res/icons/info.png, src/qt/res/icons/key.png, - src/qt/res/icons/lock_*.png, src/qt/res/icons/open.png, - src/qt/res/icons/overview.png, src/qt/res/icons/quit.png, - src/qt/res/icons/receive.png, src/qt/res/icons/remove.png, - src/qt/res/icons/send.png, src/qt/res/icons/synced.png, - src/qt/res/icons/transaction*.png, src/qt/res/icons/tx_output.png, - src/qt/res/icons/warning.png - -Jonas Schnelli ------------------------ - -### Info -* Designer: Jonas Schnelli -* Bitcoin Icon: (based on the original bitcoin logo from Bitboy) -* Some icons are based on Stephan Hutchings Typicons -* License: MIT - -### Assets Used - src/qt/res/icons/about.png, src/qt/res/icons/about_qt.png, - src/qt/res/icons/bitcoin.icns, src/qt/res/icons/bitcoin.ico, - src/qt/res/icons/bitcoin.png, src/qt/res/icons/clock*.png, - src/qt/res/icons/connect[0-3].png, src/qt/res/icons/eye_minus.png, - src/qt/res/icons/eye_plus.png, src/qt/res/icons/verify.png, - src/qt/res/icons/tx_inout.png, src/qt/res/icons/tx_input.png, - src/qt/res/src/verify.svg, src/qt/res/src/bitcoin.svg, - src/qt/res/src/clock*.svg, src/qt/res/src/connect*.svg, - src/qt/res/src/mine.svg, src/qt/res/src/qt.svg, src/qt/res/src/tx*.svg, - src/qt/res/src/verify.svg, diff --git a/doc/bips.md b/doc/bips.md deleted file mode 100644 index e8ed0f1d..00000000 --- a/doc/bips.md +++ /dev/null @@ -1,20 +0,0 @@ -*** Warning: This document has not been updated for Zcash and may be inaccurate. *** - -BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.10.0**): - -* [`BIP 11`](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki): Multisig outputs are standard since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)). -* [`BIP 13`](https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki): The address format for P2SH addresses has been implemented since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)). -* [`BIP 14`](https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki): The subversion string is being used as User Agent since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)). -* [`BIP 16`](https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki): The pay-to-script-hash evaluation rules have been implemented since **v0.6.0**, and took effect on *April 1st 2012* ([PR #748](https://github.com/bitcoin/bitcoin/pull/748)). -* [`BIP 21`](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki): The URI format for Bitcoin payments has been implemented since **v0.6.0** ([PR #176](https://github.com/bitcoin/bitcoin/pull/176)). -* [`BIP 22`](https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki): The 'getblocktemplate' (GBT) RPC protocol for mining has been implemented since **v0.7.0** ([PR #936](https://github.com/bitcoin/bitcoin/pull/936)). -* [`BIP 23`](https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki): Some extensions to GBT have been implemented since **v0.10.0rc1**, including longpolling and block proposals ([PR #1816](https://github.com/bitcoin/bitcoin/pull/1816)). -* [`BIP 30`](https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki): The evaluation rules to forbid creating new transactions with the same txid as previous not-fully-spent transactions were implemented since **v0.6.0**, and the rule took effect on *March 15th 2012* ([PR #915](https://github.com/bitcoin/bitcoin/pull/915)). -* [`BIP 31`](https://github.com/bitcoin/bips/blob/master/bip-0031.mediawiki): The 'pong' protocol message (and the protocol version bump to 60001) has been implemented since **v0.6.1** ([PR #1081](https://github.com/bitcoin/bitcoin/pull/1081)). -* [`BIP 34`](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki): The rule that requires blocks to contain their height (number) in the coinbase input, and the introduction of version 2 blocks has been implemented since **v0.7.0**. The rule took effect for version 2 blocks as of *block 224413* (March 5th 2013), and version 1 blocks are no longer allowed since *block 227931* (March 25th 2013) ([PR #1526](https://github.com/bitcoin/bitcoin/pull/1526)). -* [`BIP 35`](https://github.com/bitcoin/bips/blob/master/bip-0035.mediawiki): The 'mempool' protocol message (and the protocol version bump to 60002) has been implemented since **v0.7.0** ([PR #1641](https://github.com/bitcoin/bitcoin/pull/1641)). -* [`BIP 37`](https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki): The bloom filtering for transaction relaying, partial merkle trees for blocks, and the protocol version bump to 70001 (enabling low-bandwidth SPV clients) has been implemented since **v0.8.0** ([PR #1795](https://github.com/bitcoin/bitcoin/pull/1795)). -* [`BIP 42`](https://github.com/bitcoin/bips/blob/master/bip-0042.mediawiki): The bug that would have caused the subsidy schedule to resume after block 13440000 was fixed in **v0.9.2** ([PR #3842](https://github.com/bitcoin/bitcoin/pull/3842)). -* [`BIP 61`](https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki): The 'reject' protocol message (and the protocol version bump to 70002) was added in **v0.9.0** ([PR #3185](https://github.com/bitcoin/bitcoin/pull/3185)). -* [`BIP 66`](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki): The strict DER rules and associated version 3 blocks have been implemented since **v0.10.0** ([PR #5713](https://github.com/bitcoin/bitcoin/pull/5713)). -* [`BIP 70`](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) [`71`](https://github.com/bitcoin/bips/blob/master/bip-0071.mediawiki) [`72`](https://github.com/bitcoin/bips/blob/master/bip-0072.mediawiki): Payment Protocol support has been available in Bitcoin Core GUI since **v0.9.0** ([PR #5216](https://github.com/bitcoin/bitcoin/pull/5216)). diff --git a/doc/release-notes.md b/doc/release-notes.md deleted file mode 100644 index 1824960b..00000000 --- a/doc/release-notes.md +++ /dev/null @@ -1,219 +0,0 @@ -*** Warning: This document has not been updated for Zcash and may be inaccurate. *** - -Bitcoin Core version 0.11.2 is now available from: - - - -This is a new minor version release, bringing bug fixes, the BIP65 -(CLTV) consensus change, and relay policy preparation for BIP113. It is -recommended to upgrade to this version as soon as possible. - -Please report bugs using the issue tracker at github: - - - -Upgrading and downgrading -========================= - -How to Upgrade --------------- - -If you are running an older version, shut it down. Wait until it has completely -shut down (which might take a few minutes for older versions), then run the -installer (on Windows) or just copy over /Applications/Bitcoin-Qt (on Mac) or -bitcoind/bitcoin-qt (on Linux). - -Downgrade warning ------------------- - -Because release 0.10.0 and later makes use of headers-first synchronization and -parallel block download (see further), the block files and databases are not -backwards-compatible with pre-0.10 versions of Bitcoin Core or other software: - -* Blocks will be stored on disk out of order (in the order they are -received, really), which makes it incompatible with some tools or -other programs. Reindexing using earlier versions will also not work -anymore as a result of this. - -* The block index database will now hold headers for which no block is -stored on disk, which earlier versions won't support. - -If you want to be able to downgrade smoothly, make a backup of your entire data -directory. Without this your node will need start syncing (or importing from -bootstrap.dat) anew afterwards. It is possible that the data from a completely -synchronised 0.10 node may be usable in older versions as-is, but this is not -supported and may break as soon as the older version attempts to reindex. - -This does not affect wallet forward or backward compatibility. There are no -known problems when downgrading from 0.11.x to 0.10.x. - -Notable changes since 0.11.1 -============================ - -BIP65 soft fork to enforce OP_CHECKLOCKTIMEVERIFY opcode --------------------------------------------------------- - -This release includes several changes related to the [BIP65][] soft fork -which redefines the existing OP_NOP2 opcode as OP_CHECKLOCKTIMEVERIFY -(CLTV) so that a transaction output can be made unspendable until a -specified point in the future. - -1. This release will only relay and mine transactions spending a CLTV - output if they comply with the BIP65 rules as provided in code. - -2. This release will produce version 4 blocks by default. Please see the - *notice to miners* below. - -3. Once 951 out of a sequence of 1,001 blocks on the local node's best block - chain contain version 4 (or higher) blocks, this release will no - longer accept new version 3 blocks and it will only accept version 4 - blocks if they comply with the BIP65 rules for CLTV. - -For more information about the soft-forking change, please see - - -Graphs showing the progress towards block version 4 adoption may be -found at the URLs below: - -- Block versions over the last 50,000 blocks as progress towards BIP65 - consensus enforcement: - -- Block versions over the last 2,000 blocks showing the days to the - earliest possible BIP65 consensus-enforced block: - -**Notice to miners:** Bitcoin Core’s block templates are now for -version 4 blocks only, and any mining software relying on its -getblocktemplate must be updated in parallel to use libblkmaker either -version 0.4.3 or any version from 0.5.2 onward. - -- If you are solo mining, this will affect you the moment you upgrade - Bitcoin Core, which must be done prior to BIP65 achieving its 951/1001 - status. - -- If you are mining with the stratum mining protocol: this does not - affect you. - -- If you are mining with the getblocktemplate protocol to a pool: this - will affect you at the pool operator’s discretion, which must be no - later than BIP65 achieving its 951/1001 status. - -[BIP65]: https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki - -BIP113 mempool-only locktime enforcement using GetMedianTimePast() ----------------------------------------------------------------- - -Bitcoin transactions currently may specify a locktime indicating when -they may be added to a valid block. Current consensus rules require -that blocks have a block header time greater than the locktime specified -in any transaction in that block. - -Miners get to choose what time they use for their header time, with the -consensus rule being that no node will accept a block whose time is more -than two hours in the future. This creates a incentive for miners to -set their header times to future values in order to include locktimed -transactions which weren't supposed to be included for up to two more -hours. - -The consensus rules also specify that valid blocks may have a header -time greater than that of the median of the 11 previous blocks. This -GetMedianTimePast() time has a key feature we generally associate with -time: it can't go backwards. - -[BIP113][] specifies a soft fork (**not enforced in this release**) that -weakens this perverse incentive for individual miners to use a future -time by requiring that valid blocks have a computed GetMedianTimePast() -greater than the locktime specified in any transaction in that block. - -Mempool inclusion rules currently require transactions to be valid for -immediate inclusion in a block in order to be accepted into the mempool. -This release begins applying the BIP113 rule to received transactions, -so transaction whose time is greater than the GetMedianTimePast() will -no longer be accepted into the mempool. - -**Implication for miners:** you will begin rejecting transactions that -would not be valid under BIP113, which will prevent you from producing -invalid blocks if/when BIP113 is enforced on the network. Any -transactions which are valid under the current rules but not yet valid -under the BIP113 rules will either be mined by other miners or delayed -until they are valid under BIP113. Note, however, that time-based -locktime transactions are more or less unseen on the network currently. - -**Implication for users:** GetMedianTimePast() always trails behind the -current time, so a transaction locktime set to the present time will be -rejected by nodes running this release until the median time moves -forward. To compensate, subtract one hour (3,600 seconds) from your -locktimes to allow those transactions to be included in mempools at -approximately the expected time. - -[BIP113]: https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki - -Windows bug fix for corrupted UTXO database on unclean shutdowns ----------------------------------------------------------------- - -Several Windows users reported that they often need to reindex the -entire blockchain after an unclean shutdown of Bitcoin Core on Windows -(or an unclean shutdown of Windows itself). Although unclean shutdowns -remain unsafe, this release no longer relies on memory-mapped files for -the UTXO database, which significantly reduced the frequency of unclean -shutdowns leading to required reindexes during testing. - -For more information, see: - -Other fixes for database corruption on Windows are expected in the -next major release. - -0.11.2 Change log -================= - -Detailed release notes follow. This overview includes changes that affect -behavior, not code moves, refactors and string updates. For convenience in locating -the code changes and accompanying discussion, both the pull request and -git merge commit are mentioned. - -- #6124 `684636b` Make CScriptNum() take nMaxNumSize as an argument -- #6124 `4fa7a04` Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) -- #6124 `6ea5ca4` Enable CHECKLOCKTIMEVERIFY as a standard script verify flag -- #6351 `5e82e1c` Add CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic -- #6353 `ba1da90` Show softfork status in getblockchaininfo -- #6351 `6af25b0` Add BIP65 to getblockchaininfo softforks list -- #6688 `01878c9` Fix locking in GetTransaction -- #6653 `b3eaa30` [Qt] Raise debug window when requested -- #6600 `1e672ae` Debian/Ubuntu: Include bitcoin-tx binary -- #6600 `2394f4d` Debian/Ubuntu: Split bitcoin-tx into its own package -- #5987 `33d6825` Bugfix: Allow mining on top of old tip blocks for testnet -- #6852 `21e58b8` build: make sure OpenSSL heeds noexecstack -- #6846 `af6edac` alias `-h` for `--help` -- #6867 `95a5039` Set TCP_NODELAY on P2P sockets. -- #6856 `dfe55bd` Do not allow blockfile pruning during reindex. -- #6566 `a1d3c6f` Add rules--presently disabled--for using GetMedianTimePast as end point for lock-time calculations -- #6566 `f720c5f` Enable policy enforcing GetMedianTimePast as the end point of lock-time constraints -- #6917 `0af5b8e` leveldb: Win32WritableFile without memory mapping -- #6948 `4e895b0` Always flush block and undo when switching to new file - -Credits -======= - -Thanks to everyone who directly contributed to this release: - -- Alex Morcos -- ฿tcDrak -- Chris Kleeschulte -- Daniel Cousens -- Diego Viola -- Eric Lombrozo -- Esteban Ordano -- Gregory Maxwell -- Luke Dashjr -- Marco Falke -- Mark Friedenbach -- Matt Corallo -- Micha -- Mitchell Cash -- Peter Todd -- Pieter Wuille -- Wladimir J. van der Laan -- Zak Wilcox - -And those who contributed additional code review and/or security research. - -As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/bitcoin/). From 82dd46a6d84291b69e68a7f65981b1489fa6fbea Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 7 Oct 2016 16:22:26 -0700 Subject: [PATCH 012/104] Add note that document is not updated for Zcash to translation policy --- doc/translation_strings_policy.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/translation_strings_policy.md b/doc/translation_strings_policy.md index 1a7decf5..1c555b1f 100644 --- a/doc/translation_strings_policy.md +++ b/doc/translation_strings_policy.md @@ -1,3 +1,5 @@ +*** Warning: This document has not been updated for Zcash and may be inaccurate. *** + Translation Strings Policy =========================== From 098af42f36e8b6c8b80d29c19d6153cc2510a0d9 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 7 Oct 2016 16:22:52 -0700 Subject: [PATCH 013/104] Rm doc for disabled REST interface --- doc/REST-interface.md | 83 ------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 doc/REST-interface.md diff --git a/doc/REST-interface.md b/doc/REST-interface.md deleted file mode 100644 index ebd88ca6..00000000 --- a/doc/REST-interface.md +++ /dev/null @@ -1,83 +0,0 @@ -*** Warning: This document has not been updated for Zcash and may be inaccurate. *** - -Unauthenticated REST Interface -============================== - -The REST API can be enabled with the `-rest` option. - -Supported API -------------- - -####Transactions -`GET /rest/tx/.` - -Given a transaction hash: returns a transaction in binary, hex-encoded binary, or JSON formats. - -For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option. - -####Blocks -`GET /rest/block/.` -`GET /rest/block/notxdetails/.` - -Given a block hash: returns a block, in binary, hex-encoded binary or JSON formats. - -The HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request. - -With the /notxdetails/ option JSON response will only contain the transaction hash instead of the complete transaction details. The option only affects the JSON response. - -####Blockheaders -`GET /rest/headers//.` - -Given a block hash: returns amount of blockheaders in upward direction. - -JSON is not supported. - -####Chaininfos -`GET /rest/chaininfo.json` - -Returns various state info regarding block chain processing. -Only supports JSON as output format. -* chain : (string) current network name as defined in BIP70 (main, test, regtest) -* blocks : (numeric) the current number of blocks processed in the server -* headers : (numeric) the current number of headers we have validated -* bestblockhash : (string) the hash of the currently best block -* difficulty : (numeric) the current difficulty -* verificationprogress : (numeric) estimate of verification progress [0..1] -* chainwork : (string) total amount of work in active chain, in hexadecimal - -####Query UTXO set -`GET /rest/getutxos//-/-/.../-.` - -The getutxo command allows querying of the UTXO set given a set of outpoints. -See BIP64 for input and output serialisation: -https://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki - -Example: -``` -$ curl localhost:18232/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75-0.json 2>/dev/null | json_pp -{ - "chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb", - "chainHeight" : 325347, - "utxos" : [ - { - "scriptPubKey" : { - "addresses" : [ - "mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD" - ], - "type" : "pubkeyhash", - "hex" : "76a9141c7cebb529b86a04c683dfa87be49de35bcf589e88ac", - "reqSigs" : 1, - "asm" : "OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG" - }, - "value" : 8.8687, - "height" : 2147483647, - "txvers" : 1 - } - ], - "bitmap" : "1" -} -``` - -Risks -------------- -Running a web browser on the same node with a REST enabled bitcoind can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `