bitcoind json API (gettx/raw) (newbie questions #2)



Summary:

The author is seeking clarification on the gettx / getrawtransaction (decoded) API call. They understand that they can find the address a transaction output is directed to in the vout array in the scriptPubKey.addresses array but are unsure why this information is typed as an array when it generally contains only one address. They ask if there are cases where this array contains more or fewer than one address, or if it is structured this way for future extensibility. For spending the coins in a future transaction, the author believes it is all about owning the public/private key in the vout script, and the address does not matter. The author is working on a project to calculate unspent outputs and balances for all accounts and is unsure of any special cases they need to consider to produce accurate data.


Updated on: 2023-06-08T03:00:33.754615+00:00