Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In regtest mode with bitcoind backend, wallet does not pick up coinbase outputs #265

Open
GambolingPangolin opened this issue Oct 14, 2021 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@GambolingPangolin
Copy link

Setup

  • Start a regtest node
  • Start sparrow with -n regtest and configure it to connect to the node we just started
  • Create a P2WPKH wallet with private keys
  • Run bitcoin-cli -regtest generatetoaddress 110 $sparrow_address

Expected behavior

110 new UTXOs should appear in the wallet, with 10 spendable and 100 in a mined, but unspendable state.

Actual behavior

No transactions show up in the wallet. This may also occur on mainnet. I don't have a way to check.

System information

  • Sparrow 1.5.1
  • Bitcoin Core 22.0
  • Ubuntu 20.04
@craigraw
Copy link
Collaborator

Did you try a wallet refresh (View menu)?

Sparrow uses BWT to connect to Bitcoin Core, which may not function in the way you are expecting for this use case. @shesek would be able to say more.

@GambolingPangolin
Copy link
Author

Did you try a wallet refresh (View menu)?

I'm afraid so. I also tried closing and reopening the application.

@shesek
Copy link

shesek commented Oct 16, 2021

BWT does not currently support coinbase outputs, the indexer skips over them.

Adding support for indexing mature coinbase outputs should be straightforward, but immature ones requires some more thought. The Electrum RPC protocol doesn't have a way to specify whether an output is mature or not (i.e. in listunspent), so I'm not sure if/how it should be included there. For the BWT HTTP API I could add a new field to indicate this.

In addition, the wallet software will need to recognize coinbase outputs and avoid using them for coin selection until they're matured. @craigraw Would Sparrow handle this correctly?

(I created bwt-dev/bwt#93 to keep track of this.)

@craigraw
Copy link
Collaborator

The Electrum RPC protocol doesn't have a way to specify whether an output is mature or not

Agreed - I think that the maturity of the output should be ignored and simply listed as unspent - which is correct. The wallet software can handle the coin selection criteria.

Would Sparrow handle this correctly?

Indeed it did not. I've now implemented this in sparrowwallet/drongo@57290a2 and 237f978.

@6102bitcoin 6102bitcoin added the documentation Improvements or additions to documentation label Nov 17, 2021
@kdmukai
Copy link

kdmukai commented Dec 13, 2023

Bump! Behavior seems to be the same in Sparrow v1.8.1. Neither mature nor immature coinbase outputs are found.

Same setup: bitcoind (v24.0.1) in regtest.

Is there a workaround?

@craigraw
Copy link
Collaborator

On the list to add to Cormorant (Sparrow's Bitcoin Core RPC library) for the next version. The workaround for now is to use an Electrum server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants
@craigraw @shesek @kdmukai @GambolingPangolin @6102bitcoin and others