Bitcoin Core Github
44 subscribers
120K links
Download Telegram
⚠️ FacehuggerCZ opened an issue: "Obscure problem with sent transactions and wallet balance"
(https://github.com/bitcoin/bitcoin/issues/29024)
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current behaviour

Hello,

I need help explaining this problem:
![bitcoin core balance](https://github.com/bitcoin/bitcoin/assets/153189455/63b8d934-0974-447c-965b-1bc74607a347)
![bitcoin core transactions](https://github.com/bitcoin/bitcoin/assets/153189455/747d30a2-9ff7-4ceb-b9f6-b01763b78a5f)
![transactions](https://github.com/bitcoin/bitcoin/assets/153189455/d425fb83-a980-41da-83c5-9279a72f93c4)


...
πŸ’¬ maflcko commented on issue "Obscure problem with sent transactions and wallet balance":
(https://github.com/bitcoin/bitcoin/issues/29024#issuecomment-1845296159)
A transaction may have a change output, if the amounts of all input coins is larger than the transaction fee and the transaction recipient outputs.
πŸ’¬ MarnixCroes commented on issue "Obscure problem with sent transactions and wallet balance":
(https://github.com/bitcoin/bitcoin/issues/29024#issuecomment-1845296907)
@FacehuggerCZ
In Bitcoin Core the outgoing amount of a transaction is the amount you entered to send + mining fee.
So that's why you see on an explorer that the address received 0.1, but the outgoing tx amount in Bitcoin core is 0.10061201.
0.1 plus the fee add up to the tx outgoing amount.
![image](https://github.com/bitcoin/bitcoin/assets/93143998/cc0bf9c8-6546-41c3-9072-0c456311040c)

The second questions "What are these addresses", those are the change addresses. It's how Bitcoin work
...
πŸ’¬ maflcko commented on pull request "wallet: No BDB creation, unless -deprecatedrpc=create_bdb":
(https://github.com/bitcoin/bitcoin/pull/28597#issuecomment-1845299642)
> This should have had release notes.

A label was added after merge, but it looks like no one went through those. Currently there are 4 tagged: https://github.com/bitcoin/bitcoin/issues?q=label%3A%22Needs+release+note%22+is%3Aclosed
πŸ’¬ Retropex commented on pull request "datacarriersize: Match more datacarrying":
(https://github.com/bitcoin/bitcoin/pull/28408#issuecomment-1845301063)
The problem is that they use a diverted means to include data instead of using `OP_RETURN` which has been more or less adapted for this, in particular by not bloating the UTXOs set, that they have an unfair fee reduction compared to `OP_RETURN` and that they unbalance the incentives of miners.

Miners could, for example, start creating this kind of tx (BRC-20) to get richer than it will by mining normal financial txs.
πŸ’¬ maflcko commented on issue "Obscure problem with sent transactions and wallet balance":
(https://github.com/bitcoin/bitcoin/issues/29024#issuecomment-1845308131)
Usually the issue tracker is used to track technical issues related to the Bitcoin Core code base. General bitcoin questions and/or support requests are best directed to the [Bitcoin StackExchange](https://bitcoin.stackexchange.com) or the `#bitcoin` IRC channel on Libera Chat, or any other place that you feel is well suited.
πŸ’¬ fanquake commented on pull request "doc: add historical release notes for 26.0":
(https://github.com/bitcoin/bitcoin/pull/29023#issuecomment-1845335433)
Hmm. Looks like a few things [missed out on being added](https://github.com/bitcoin/bitcoin/issues?q=label%3A%22Needs+release+note%22+). Generally we don't change the release notes after they've been finalized, and any updates we make here, wont be reflected on the website, in the 26.x branch, on the mailing list etc, but it might still be worth doing.
πŸ’¬ fanquake commented on pull request "BIP324 integration":
(https://github.com/bitcoin/bitcoin/pull/28331#issuecomment-1845335825)
Removing label, as this got a release note.
πŸ€” Sjors reviewed a pull request: "wallet: Have the wallet store the key for automatically generated descriptors"
(https://github.com/bitcoin/bitcoin/pull/26728#pullrequestreview-1770044461)
Mostly happy with a86756aed266a1c7569dc3849f66f468f3810821.

Still need to re-review ea7a61ca94cc0d59cfe25307cd60fcda2aedec5f.
πŸ’¬ Sjors commented on pull request "wallet: Have the wallet store the key for automatically generated descriptors":
(https://github.com/bitcoin/bitcoin/pull/26728#discussion_r1418907338)
e67898f47152b756acc7ccafb654e2600b0e7a03 nit: could be its own commit?
πŸ’¬ Sjors commented on pull request "wallet: Have the wallet store the key for automatically generated descriptors":
(https://github.com/bitcoin/bitcoin/pull/26728#discussion_r1418884402)
e491e5c4e6eb2f9b9ec53f4c2df602a755178726: could make it more clear that this only needs to happen for _one_ descriptor: `if (!wallet_key && …`

Additionally, either here or elsewhere, it's useful to clarify the following:

```cpp
// Although at this point in the loading process we can't tell if a descriptor is active,
// checking inactive descriptors is necessary in any case. The private key for the active
// wallet master extended public key will initially be found in all active descript
...
πŸ’¬ Sjors commented on pull request "wallet: Have the wallet store the key for automatically generated descriptors":
(https://github.com/bitcoin/bitcoin/pull/26728#discussion_r1418940623)
a5ba1d83827475ef3f8f3851733007db5b8dc848: not a fan of touching legacy wallets even in the slightest if we don't have to… in that respect I prefer fca4584ad3.

It seems contradictory to the fact that we _always_ generate the global hd key field when migrating a legacy wallet, whether it was newly created or not. We _could_ set this field when creating a legacy wallet, but we (gladly) choose not to. It wouldn't do anything useful and would suffer from the same downgrade->encrypt->upgrade incorr
...
πŸ’¬ Sjors commented on pull request "wallet: Have the wallet store the key for automatically generated descriptors":
(https://github.com/bitcoin/bitcoin/pull/26728#discussion_r1418924286)
6d7163d8e8127a18a299eaa1309bf7d613713d51: maybe assert that either `key` or `crypted_key` is provided
πŸ’¬ Sjors commented on pull request "wallet: Have the wallet store the key for automatically generated descriptors":
(https://github.com/bitcoin/bitcoin/pull/26728#discussion_r1418893185)
e491e5c4e6eb2f9b9ec53f4c2df602a755178726: I thought about adding an additional warning here for the scenario where a user downgraded, encrypted and upgraded. However, for that we need to know if the descriptor is active, which this function (`LoadDescriptorWalletRecords`) doesn't know. The caller `LoadWallet` won't know it until `LoadActiveSPKMs`. So it would involve passing a bunch of information around.

Anyway, in principle we could count the number of active descriptors for which `pubkey =
...
πŸ’¬ maflcko commented on pull request "doc: add historical release notes for 26.0":
(https://github.com/bitcoin/bitcoin/pull/29023#discussion_r1418994026)
nit: This is already mentioned above, no? `- Ensure the "Needs release note" label is removed from all relevant pull requests and issues.`
πŸ’¬ fanquake commented on pull request "doc: add historical release notes for 26.0":
(https://github.com/bitcoin/bitcoin/pull/29023#discussion_r1418997032)
Ah, I guess it might be more useful in the section about writing the release notes.
πŸ’¬ fanquake commented on pull request "doc: add historical release notes for 26.0":
(https://github.com/bitcoin/bitcoin/pull/29023#discussion_r1418999090)
I'll just remove my addition. I guess the onus is on PR authors to make sure they write release notes for their changes.
πŸ’¬ murchandamus commented on pull request "wallet: skip BnB when SFFO is enabled":
(https://github.com/bitcoin/bitcoin/pull/28994#discussion_r1419002221)
I think @josibake is making a good point here. Algorithm and waste score by itself would probably still make it difficult to learn something about what went wrong (although they would be useful if the issue filer also provided the corresponding transaction). It might be better to also log the parameters for the coin selection attempt:

- feerate
- sffo (true/false)
- preset inputs (true/false)
- resulting input count (per type?)
- change created (true/false)
- algo that lead to solution

...
πŸ’¬ fanquake commented on pull request "doc: add historical release notes for 26.0":
(https://github.com/bitcoin/bitcoin/pull/29023#issuecomment-1845386299)
I've pinged a few people about writing up notes. I'll incorporate them here.
βœ… FacehuggerCZ closed an issue: "Obscure problem with sent transactions and wallet balance"
(https://github.com/bitcoin/bitcoin/issues/29024)