bitcoin/doc
Ava Chow b2af068825
Merge bitcoin/bitcoin#30708: rpc: add getdescriptoractivity
37a5c5d836 doc: update descriptors.md for getdescriptoractivity (James O'Beirne)
ee3ce6a4f4 test: rpc: add no address case for getdescriptoractivity (James O'Beirne)
811f76f3a5 rpc: add getdescriptoractivity (James O'Beirne)
25fe087de5 rpc: move-only: move ScriptPubKeyDoc to utils (James O'Beirne)

Pull request description:

  The RPC command `scanblocks` provides a useful way to get a set of blockhashes that have activity relevant to a set of descriptors (`relevant_blocks`). However actually extracting the activity from those blocks is left as an exercise to the end user.

  This process involves not only generating the (potentially ranged) set of scripts for the descriptor set on the client side (maybe via `deriveaddresses`), but then the user must retrieve each block's contents one-by-one using `getblock <hash>`, which is transmitted over a network link. And that's all before they perform the actual search over block content. There's even more work required to incorporate unconfirmed transactions.

  This PR introduces an RPC `getdescriptoractivity` that [dovetails](https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2024-08-16#1046393;) with `scanblocks` output, handling the process described above. Users specify the blockhashes (perhaps from `relevant_blocks`) and a set of descriptors; they are then given all spend/receive activity in that set of blocks.

  This is a very useful tool when implementing lightweight wallets that want neither to require a third-party indexer like electrs, nor the overhead of creating and managing watch-only wallets in Core. This allows Core to be more easily used in a "stateless" manner by wallets, with potentially many nodes interchangeably acting as backends.

  ### Example usage

  ```
  % ./src/bitcoin-cli scanblocks start \
      '["addr(bc1p0cp0vyag6snlta2l7c4am3rue7eef9f72l7uhx52m4v27vfydx9s8tfs7t)"]' \
      857263
  {
    "from_height": 857263,
    "to_height": 858263,
    "relevant_blocks": [
      "00000000000000000002bc5cc78f5b0913a5230a8f4b0d5060bc9a60900a5a88",
      "00000000000000000001c5291ed6a40c06d3db5c8fb738567654b24a14b24ecb"
    ],
    "completed": true
  }

  % ./src/bitcoin-cli getdescriptoractivity \
      '["00000000000000000002bc5cc78f5b0913a5230a8f4b0d5060bc9a60900a5a88", "00000000000000000001c5291ed6a40c06d3db5c8fb738567654b24a14b24ecb"]' \
      '["addr(bc1p0cp0vyag6snlta2l7c4am3rue7eef9f72l7uhx52m4v27vfydx9s8tfs7t)"]'
  {
    "activity": [
      {
        "type": "receive",
        "amount": 0.00002900,
        "blockhash": "00000000000000000002bc5cc78f5b0913a5230a8f4b0d5060bc9a60900a5a88",
        "height": 857907,
        "txid": "c9d34f202c1f66d80cae76f305350f5fdde910b97cf6ae6bf79f5bcf2a337d06",
        "vout": 254,
        "output_spk": {
          "asm": "1 7e02f613a8d427f5f55ff62bddc47ccfb394953e57fdcb9a8add58af3124698b",
          "desc": "rawtr(7e02f613a8d427f5f55ff62bddc47ccfb394953e57fdcb9a8add58af3124698b)#yewcd80j",
          "hex": "51207e02f613a8d427f5f55ff62bddc47ccfb394953e57fdcb9a8add58af3124698b",
          "address": "bc1p0cp0vyag6snlta2l7c4am3rue7eef9f72l7uhx52m4v27vfydx9s8tfs7t",
          "type": "witness_v1_taproot"
        }
      },
      {
        "type": "spend",
        "amount": 0.00002900,
        "blockhash": "00000000000000000001c5291ed6a40c06d3db5c8fb738567654b24a14b24ecb",
        "height": 858260,
        "spend_txid": "7f61d1b248d4ee46376f9c6df272f63fbb0c17039381fb23ca5d90473b823c36",
        "spend_vin": 0,
        "prevout_txid": "c9d34f202c1f66d80cae76f305350f5fdde910b97cf6ae6bf79f5bcf2a337d06",
        "prevout_vout": 254,
        "prevout_spk": {
          "asm": "1 7e02f613a8d427f5f55ff62bddc47ccfb394953e57fdcb9a8add58af3124698b",
          "desc": "rawtr(7e02f613a8d427f5f55ff62bddc47ccfb394953e57fdcb9a8add58af3124698b)#yewcd80j",
          "hex": "51207e02f613a8d427f5f55ff62bddc47ccfb394953e57fdcb9a8add58af3124698b",
          "address": "bc1p0cp0vyag6snlta2l7c4am3rue7eef9f72l7uhx52m4v27vfydx9s8tfs7t",
          "type": "witness_v1_taproot"
        }
      }
    ]
  }
  ```

ACKs for top commit:
  instagibbs:
    reACK 37a5c5d836
  achow101:
    ACK 37a5c5d836
  tdb3:
    Code review and light retest ACK 37a5c5d836
  rkrux:
    re-ACK 37a5c5d836

Tree-SHA512: 04aa51e329c6c2ed72464b9886281d5ebd7511a8a8e184ea81249033a4dad535a12829b1010afc2da79b344ea8b5ab8ed47e426d0bf2eb78ab395d20b1da8dbb
2024-11-27 12:23:35 -05:00
..
design doc: multiprocess documentation improvements 2024-09-23 15:03:04 -05:00
man build: Remove Autotools-based build system 2024-08-30 21:31:39 +01:00
policy docs: remove requirement to signal bip125 2024-10-31 13:19:31 -04:00
release-notes doc: archive release notes for v27.2 2024-11-04 11:19:54 +00:00
assets-attribution.md [doc] Merge doc/assets-attribution.md into contrib/debian/copyright 2015-09-18 18:14:42 +02:00
assumeutxo.md doc: fix assumeutxo design doc link 2024-09-04 22:53:34 +01:00
benchmarking.md doc: replace -? with -h for bench_bitcoin help 2024-10-19 18:44:22 +02:00
bips.md docs: remove requirement to signal bip125 2024-10-31 13:19:31 -04:00
bitcoin-conf.md doc: add testnet4 section header for config file 2024-10-01 15:18:12 +02:00
bitcoin_logo_doxygen.png Lossless image optimization 2013-12-02 10:10:22 +01:00
build-freebsd.md doc: remove mentions of UPnP 2024-10-25 09:27:29 -04:00
build-netbsd.md doc: Update for CMake-based build system 2024-08-16 21:24:08 +01:00
build-openbsd.md doc: remove mentions of UPnP 2024-10-25 09:27:29 -04:00
build-osx.md doc: migrate from pkg-config to pkgconf in macOS build docs 2024-11-21 10:28:44 +00:00
build-unix.md cmake: Revamp FindLibevent module 2024-11-06 15:40:34 +00:00
build-windows-msvc.md build, msvc: Enable libqrencode vcpkg package 2024-11-05 16:38:56 +00:00
build-windows.md doc: remove dependency install instructions from win docs 2024-10-16 14:47:11 +01:00
cjdns.md doc: update getnodeaddresses for CJDNS, I2P and Tor and rm link 2023-06-01 15:52:51 +02:00
CMakeLists.txt cmake: add USE_SOURCE_PERMISSIONS to all configure_file usage 2024-09-06 10:52:19 +01:00
dependencies.md doc: remove mentions of UPnP 2024-10-25 09:27:29 -04:00
descriptors.md doc: update descriptors.md for getdescriptoractivity 2024-11-26 20:47:11 -05:00
developer-notes.md doc: Fix word order in developer-notes.md 2024-11-04 20:05:14 -08:00
dnsseed-policy.md Update the developer mailing list address. 2024-04-02 15:38:40 -03:00
Doxyfile.in build: Rename PACKAGE_* variables to CLIENT_* 2024-10-28 12:35:55 +00:00
external-signer.md wallet: compare address returned by displayaddress 2024-04-16 17:47:43 +02:00
files.md Merge bitcoin/bitcoin#29775: Testnet4 including PoW difficulty adjustment fix 2024-08-07 13:05:04 -04:00
fuzzing.md doc: fuzz: remove Honggfuzz NetDriver instructions 2024-10-15 07:46:54 -03:00
guix.md docs: Point to contrib/guix/README.md in doc/guix.md 2021-01-08 11:40:01 -05:00
i2p.md doc: i2p: improve -i2pacceptincoming mention 2024-04-04 18:32:39 -03:00
init.md Merge bitcoin/bitcoin#28167: init: Add option for rpccookie permissions (replace 26088) 2024-06-27 17:35:08 -04:00
JSON-RPC-interface.md minor: remove unnecessary semicolons from RPC content type examples 2024-06-07 10:47:24 -04:00
managing-wallets.md Merge bitcoin/bitcoin#27064: system: use %LOCALAPPDATA% as default datadir on windows 2024-05-23 12:11:55 -04:00
multiprocess.md doc: multiprocess documentation improvements 2024-09-23 15:03:04 -05:00
multisig-tutorial.md doc: Fix grammatical errors in multisig-tutorial.md 2024-11-05 12:13:02 -08:00
offline-signing-tutorial.md doc: Add missing 'blank=true' option in offline-signing-tutorial.md 2024-11-06 10:36:30 -08:00
p2p-bad-ports.md init, doc: improve -onlynet help and tor/i2p documentation 2022-03-03 16:14:01 +01:00
productivity.md doc: Update for CMake-based build system 2024-08-16 21:24:08 +01:00
psbt.md doc: mention descriptorprocesspsbt in psbt.md 2024-11-12 14:56:12 +01:00
README.md doc: update IBD requirements in doc/README.md 2024-10-02 17:46:11 +02:00
README_doxygen.md doc: Improve doxygen readme navigation section 2019-09-23 19:22:06 -04:00
README_windows.txt doc: Remove version numbers from READMEs 2017-04-05 09:40:48 +02:00
reduce-memory.md doc: Be vague instead of wrong about MALLOC_ARENA_MAX 2023-09-20 17:12:24 +00:00
reduce-traffic.md doc: update/clarify max outbound connection count 2023-12-11 20:05:25 +01:00
release-notes-28358.md validation: drop maximum -dbcache 2024-05-28 08:36:28 +02:00
release-notes-30239.md Add release note for ephemeral dust 2024-11-12 09:41:24 -05:00
release-notes-30592.md doc: release note for mempoolrullrbf removal 2024-10-31 13:19:31 -04:00
release-notes-30708.md rpc: add getdescriptoractivity 2024-11-26 20:47:08 -05:00
release-notes-31130.md doc: add release note for #31130 2024-10-25 09:27:30 -04:00
release-notes-31156.md doc: add release note for 31156 2024-10-28 11:38:38 -04:00
release-notes-empty-template.md release: target Windows 10 or later 2024-11-08 13:35:12 +00:00
release-process.md doc: Use relative hyperlinks in release-process.md 2024-11-03 10:45:31 +00:00
REST-interface.md doc: Fix missing comma in JSON example in REST-interface.md 2024-11-08 14:24:01 -08:00
tor.md doc: remove mentions of UPnP 2024-10-25 09:27:29 -04:00
tracing.md tracing: pass if replaced by tx/pkg to tracepoint 2024-11-13 13:27:01 -05:00
translation_process.md doc: Updating docs from autotools to cmake 2024-09-18 11:04:52 -04:00
translation_strings_policy.md doc: Updating docs from autotools to cmake 2024-09-18 11:04:52 -04:00
zmq.md doc: correct the zmq automatic build info 2024-09-25 07:07:04 -04:00

Bitcoin Core

Setup

Bitcoin Core is the original Bitcoin client and it builds the backbone of the network. It downloads and, by default, stores the entire history of Bitcoin transactions, which requires several hundred gigabytes or more of disk space. Depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to several days or more.

To download Bitcoin Core, visit bitcoincore.org.

Running

The following are some helpful notes on how to run Bitcoin Core on your native platform.

Unix

Unpack the files into a directory and run:

  • bin/bitcoin-qt (GUI) or
  • bin/bitcoind (headless)

Windows

Unpack the files into a directory, and then run bitcoin-qt.exe.

macOS

Drag Bitcoin Core to your applications folder, and then run Bitcoin Core.

Need Help?

Building

The following are developer notes on how to build Bitcoin Core on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc.

Development

The Bitcoin repo's root README contains relevant information on the development process and automated testing.

Resources

Miscellaneous

License

Distributed under the MIT software license.