From 18c2c8dd9f57ea25b933e68e4b6871a794b2d603 Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Tue, 10 Jun 2014 21:59:51 -0400 Subject: [PATCH 1/2] Add Warning About Handling Private Keys To Transaction Examples --- _includes/example_transactions.md | 7 +++++++ _includes/references.md | 1 + 2 files changed, 8 insertions(+) diff --git a/_includes/example_transactions.md b/_includes/example_transactions.md index 62cc69e0..a2d38c0f 100644 --- a/_includes/example_transactions.md +++ b/_includes/example_transactions.md @@ -486,6 +486,13 @@ Use the `dumpprivkey` RPC to get the private keys corresponding to the public keys used in the two UTXOs out inputs we will be spending. We need the private keys so we can sign each of the inputs separately. +**Warning:** Users should never manually manage private keys on mainnet. +As dangerous as raw transactions are (see warnings above), making a +mistake with a private key can be much worse---as in the case of a HD +wallet [cross-generational key compromise][devguide hardened keys]. +These examples are to help you learn, not for you to emulate on +mainnet. + {% highlight bash %} > bitcoin-cli -regtest getnewaddress n4puhBEeEWD2VvjdRC9kQuX2abKxSCMNqN diff --git a/_includes/references.md b/_includes/references.md index db42342f..c0d82ce7 100644 --- a/_includes/references.md +++ b/_includes/references.md @@ -180,6 +180,7 @@ [devex payment protocol]: /en/developer-examples#payment-protocol [devguide]: /en/developer-guide [devguide avoiding key reuse]: /en/developer-guide#avoiding-key-reuse +[devguide hardened keys]: /en/developer-guide#hardened-keys [devguide payment processing]: /en/developer-guide#payment-processing [devguide wallets]: /en/developer-guide#wallets [devref wallets]: /en/developer-reference#wallets From 85f27095c3df13dfa4d4505f59cb91c01ee7d4de Mon Sep 17 00:00:00 2001 From: "David A. Harding" Date: Tue, 10 Jun 2014 23:36:56 -0400 Subject: [PATCH 2/2] Briefly Reapeat Warning Not To Manually Manage Priv Keys In P2SH Example --- _includes/example_transactions.md | 4 ++++ _includes/references.md | 1 + 2 files changed, 5 insertions(+) diff --git a/_includes/example_transactions.md b/_includes/example_transactions.md index a2d38c0f..2e4387ad 100644 --- a/_includes/example_transactions.md +++ b/_includes/example_transactions.md @@ -1178,6 +1178,10 @@ transaction, the same way we got private keys in the Complex Raw Transaction subsection. Recall that we created a 2-of-3 multisig script, so signatures from two private keys are needed. +**Reminder:** Users should never manually manage private keys on +mainnet. See the warning in the [complex raw transaction section][devex +complex raw transaction]. +
{% highlight bash %} > bitcoin-cli -regtest signrawtransaction $RAW_TX ''' diff --git a/_includes/references.md b/_includes/references.md index c0d82ce7..d1a9bcef 100644 --- a/_includes/references.md +++ b/_includes/references.md @@ -177,6 +177,7 @@ [core paymentrequest.proto]: https://github.com/bitcoin/bitcoin/blob/master/src/qt/paymentrequest.proto [core script.h]: https://github.com/bitcoin/bitcoin/blob/master/src/script.h [DER]: https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One +[devex complex raw transaction]: /en/developer-examples#complex-raw-transaction [devex payment protocol]: /en/developer-examples#payment-protocol [devguide]: /en/developer-guide [devguide avoiding key reuse]: /en/developer-guide#avoiding-key-reuse