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

Fix and improve solo stamping #141

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Sjors
Copy link

@Sjors Sjors commented Nov 28, 2023

Currently trying to stamp with --btc-wallet will fail for two reasons:

  1. the signrawtransaction RPC has been deprecated for years
  2. it insists on at least two calendars also accepting the transaction

This PR switches to the replacement signrawtransactionwithwallet RPC. It also skips using the calendars when using --btc-wallet.

In addition it adds a --fee-rate argument so you're not dependent on whatever Bitcoin Core decides.

In case the process fails mid way after broadcasting a transaction, as it did before this PR, there's now a way to resume by passing a --nonce and --txid argument. This has the nice benefit of also making RBF possible.

Finally it documents in the README that this functionality exists, but with a warning.

Unrelated, it also adds a --btc-signet option, though at least for stamping --btc-testnet works fine with signet.

Fixes #139 and #140.

signrawtransaction was replaced with signrawtransactionwithwallet in Bitcoin Core v0.17.0

Also added debug logging.
otsclient/cmds.py Show resolved Hide resolved
@Sjors Sjors force-pushed the 2023/11/solo-stamp branch from af3b6ab to 496884e Compare February 26, 2024 09:55
@Sjors Sjors force-pushed the 2023/11/solo-stamp branch from 496884e to 640e9c8 Compare March 12, 2024 17:53

blockhash = None

logging.info('Waiting for confirmation. This can be interupted and resumed with:\nots stamp --nonce=%s --txid=%s', nonce.hex(), txid[::-1].hex())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually work as intended. You need to run ots stamp -b --nonce=x --txid=x. If the -b is left out stamping happens normally, ignoring the nonce and txid arguments.

Maybe we want --nonce and --txid to force -b on?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another issue we have right now is that if you use the txid and nonce options after a block has confirmed, ots fails to find the new block.

Maybe we could query the wallet for the transaction? Or maybe we also need a block height?

If we have all three options, we probably want to do it via a single --resume option that can find the tx even if the txid changes.

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

Successfully merging this pull request may close these issues.

Do not require calendars with --bitcoin-node
2 participants