cryptoadvance / cryptoadvance/specter-desktop
TimelockRecovery Plugin - failed after signing the first transaction
- Dominant language
- Python
- Stars
- 847
- Forks
- 259
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 2
Description
**Describe the bug**
Using Specter 2.1.8 on Umbrel, after successfully signing the first transaction (with a simulator of a hardware device), I clicked "Next" and got the following crash:
http://localhost:25441/svc/timelockrecovery/step4?wallet=simulator_wallet_with_passphrase
```
version: v2.1.8
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/cryptoadvance/specter/services/controller.py", line 43, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/oren-z0/specterext/timelockrecovery/controller.py", line 223, in step4_post
recovery_psbt.to_base64(),
File "/usr/local/lib/python3.10/site-packages/embit/psbt.py", line 661, in to_base64
return b2a_base64(self.serialize()).strip().decode()
File "/usr/local/lib/python3.10/site-packages/embit/base.py", line 45, in serialize
self.write_to(stream, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/embit/psbt.py", line 621, in write_to
tx = self.tx.serialize()
File "/usr/local/lib/python3.10/site-packages/embit/base.py", line 45, in serialize
self.write_to(stream, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/embit/transaction.py", line 82, in write_to
res += out.write_to(stream)
File "/usr/local/lib/python3.10/site-packages/embit/transaction.py", line 359, in write_to
res = stream.write(self.value.to_bytes(8, "little"))
AttributeError: 'float' object has no attribute 'to_bytes'
```
It didn't happen on version 2.1.7 with a hot wallet. I'm starting to investigate.
Contributor guide
Research direction
Start at timelockrecovery/controller.py around step4_post, where the traceback calls recovery_psbt.to_base64(), and follow the PSBT serialization path through embit/psbt.py and embit/transaction.py. Reproduce the step4 flow with the simulator wallet, then verify that the recovery PSBT serializes successfully and the request no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, cryptography
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100