bitcoindevkit / bitcoindevkit/bdk-kyoto

Missing prev_txouts

Open
#136 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
20
Forks
11
Avg merge
6m
Merged PRs (30d)
2

Description

### Description

Syncing a wallet from scratch with kyoto for incoming tx and running

```python
wallet.calculate_fee(tx)
```
gives
```
bdkpython.bdk.CalculateFeeError.MissingTxOut: out_points=[, ]
```

### Steps to reproduce

On `Signet`, `pip install bdkpython==2.0.0`. Sync the following wallet with kyoto:
```python
descriptor = "wpkh([d61bc696/84'/1'/0']tpubDCZsFxoXd76ZFhGHa9FMCJ6jf9drQeqrWcYdpb18nXfsYe2YeTkvXVB6iT2AXz5E5sSWxf1G1W3Sf7ehsMdmXEHTL8ogWZYkLA3DY8FRr98/<0;1>/*)#76zcgt8z"
scan_type = bdk.ScanType.RECOVERY(from_height=0)
```

After successful sync running

```python
wallet.calculate_fee(tx)
```
for the incoming tx https://mempool.space/signet/tx/7792eff9b668b1ffb47779c1cec7cb7c9e929d5b066e2eebfa37432121322ef8 causes this error.

### Script to reproduce issue

Download [minimal_cbf_sync.py](https://github.com/user-attachments/files/22603089/minimal_cbf_sync.py) and run
```bash
python minimal_cbf_sync.py --network signet --recovery-height 269700 "wpkh([d61bc696/84'/1'/0']tpubDCZsFxoXd76ZFhGHa9FMCJ6jf9drQeqrWcYdpb18nXfsYe2YeTkvXVB6iT2AXz5E5sSWxf1G1W3Sf7ehsMdmXEHTL8ogWZYkLA3DY8FRr98/0/*)" "wpkh([d61bc696/84'/1'/0']tpubDCZsFxoXd76ZFhGHa9FMCJ6jf9drQeqrWcYdpb18nXfsYe2YeTkvXVB6iT2AXz5E5sSWxf1G1W3Sf7ehsMdmXEHTL8ogWZYkLA3DY8FRr98/1/*)"
```

Tagging @ValuedMammal @thunderbiscuit @rustaceanrob

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the attached minimal_cbf_sync.py command on Signet with bdkpython 2.0.0 and the stated recovery height. Trace the Kyoto sync data used by wallet.calculate_fee(tx) for the linked incoming transaction and identify why its previous outputs are missing. Done means the reproduction no longer raises CalculateFeeError.MissingTxOut and the relevant behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
backend, blockchain, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.