/_includes/specials/taproot/en/04-why-wait.md

https://github.com/bitcoinops/bitcoinops.github.io · Markdown · 80 lines · 68 code · 12 blank · 0 comment · 0 complexity · 7de86d7dce8c03069a2e049a8f6e5af9 MD5 · raw file

  1. {% capture /dev/null %}
  2. <!-- Tested the following on regtest:
  3. - according to getblockchaininfo, taproot becomes active at min_lockin_height
  4. - a tx with nlocktime x can't be sent at height x-1 and can be sent at height x
  5. Not tested:
  6. - Actually spending a P2TR tx at min_lockin_height
  7. -->
  8. <!-- last block before taproot rules enforced -->
  9. {% assign ante_trb = "709,631" %}
  10. <!-- Conservatively reorg safe block after activation (+144 blocks) -->
  11. {% assign safe_trb = "709,776" %}
  12. {% endcapture %}
  13. {% auto_anchor %}
  14. Earlier entries in this series saw us encouraging developers working on
  15. wallets and services to begin implementing [taproot][topic taproot]
  16. upgrades now so that they're ready when taproot activates. But we've
  17. also warned against generating any addresses for P2TR before block
  18. {{site.trb}} as this could cause your service or your users to lose
  19. money.
  20. The reason not to generate addresses in advance is that any payment to a
  21. P2TR-style output can be spent by *anyone*
  22. prior to block {{site.trb}}. The money would be completely unsecured.
  23. But starting with that block, thousands of full nodes will begin
  24. enforcing the rules of [BIP341][] and [BIP342][] (and, by association,
  25. [BIP340][]).
  26. If it was guaranteed that there wouldn't be a reorganization of the
  27. block chain, it would be safe to start generating addresses for P2TR as
  28. soon as the final pre-taproot block was seen (block {{ante_trb}}). But
  29. there's reason to be concerned about block chain reorgs---not just
  30. accidental reorgs but also those deliberately created to take money from
  31. early P2TR payments.
  32. Imagine a large number of people all wanting to be one of the first to
  33. receive a P2TR payment. They naively send themselves some money as soon
  34. as they see block {{ante_trb}}.[^timelocked-trb] Those payments will be
  35. secure in block {{site.trb}}, but they can be stolen by any miner who
  36. creates an alternative to block {{ante_trb}}. If the value of the money
  37. sent to P2TR outputs is large enough, it could easily become more
  38. profitable to attempt to mine two blocks instead of just one (see our
  39. [fee sniping][topic fee sniping] topic for more details).
  40. For this reason, we don't recommend your software or service generate
  41. addresses for P2TR until you think the reorg risk has been effectively
  42. eliminated. We think waiting 144 blocks (approximately one day) after
  43. activation is a reasonably conservative margin that minimizes risk
  44. without significantly delaying you or your users from taking advantage
  45. of the benefits of taproot.
  46. In short:
  47. - {{ante_trb}}: last block where anyone can spend money sent to a P2TR-style output
  48. - {{site.trb}}: first block where P2TR outputs can only be spent if they satisfy
  49. the [BIP341][] and [BIP342][] rules.
  50. - {{safe_trb}}: a reasonable block at which wallets can start giving their
  51. users [bech32m][topic bech32] receiving addresses for P2TR outputs
  52. None of the above changes the advice given in the [first part][taproot
  53. series 1] of this series to enable paying to bech32m addresses as soon
  54. as possible. If someone requests payment to an address for P2TR
  55. before you think it's safe, that's their risk to take.
  56. [^timelocked-trb]:
  57. Users who want to receive a P2TR payment in the first taproot block
  58. should generate an address they don't share with anyone and then
  59. create a transaction to that address with nLockTime set to
  60. {{ante_trb}}. That transaction can be broadcast at as soon as block
  61. {{ante_trb}} has been received. The nLockTime will ensure the
  62. transaction can't be included into any block before {{site.trb}},
  63. where taproot rules are enforced. Messing about with new script
  64. types and custom locktimes can be dangerous if you don't know what
  65. you're doing, so please take care.
  66. [news139 st]: /en/newsletters/2021/03/10/#taproot-activation-discussion
  67. [taproot series 1]: /en/preparing-for-taproot/#bech32m-sending-support
  68. {% endauto_anchor %}