Skip to content

Conversation

@gregorydemay
Copy link
Contributor

@gregorydemay gregorydemay commented Dec 23, 2025

Fix the withdrawal of ckDOGE to DOGE. Transactions created by the ckDOGE minter are quite different to the ones from the ckBTC minter:

  1. They use version 1 because Dogecoin does not support BIP-68.
  2. They use the legacy P2PKH format because Dogecoin does not support segregated witness BIP-141.
  3. The transaction ID must be computed from the signed transaction, since contrary to segwit transactions, the transaction ID of legacy transactions is influenced by the signatures.

Transactions created by the ckDOGE minter are therefore widely different from the ones created by the ckBTC minter, which requires a separate implementation. In particular, the choice here is to use the Rust bitcoin library to create such transactions instead of tweaking the custom implementation used by the ckBTC minter.

Those problems also show the insufficiency of the current integration tests, which only mock the Dogecoin canister and therefore do not ensure the validity of the transactions created by the minter. This part is left for future work. The current PR was tested locally on Regtest and with the ckDOGE staging canister which successfully produced the transaction 32d24dcb.

@github-actions github-actions bot added the fix label Dec 23, 2025
@gregorydemay gregorydemay changed the title fix(ckdoge): Dogecoin transactions fix(ckdoge): use legacy P2PKH transactions for withdrawals Dec 23, 2025
@gregorydemay gregorydemay marked this pull request as ready for review December 23, 2025 14:42
@gregorydemay gregorydemay requested a review from a team as a code owner December 23, 2025 14:42
Copy link
Contributor

@mducroux mducroux left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @gregorydemay. LGTM!

Copy link
Member

@ninegua ninegua left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM. Btw, do you know how much the ckdoge canister size changed due to the new bitcoin-dogecoin dependency?

Copy link
Contributor Author

@gregorydemay gregorydemay left a comment

Choose a reason for hiding this comment

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

Forgot to push my previous comments, sorry about that

Copy link
Contributor

@mducroux mducroux left a comment

Choose a reason for hiding this comment

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

Thanks for this @gregorydemay! Left only a few minor comments

@gregorydemay gregorydemay added this pull request to the merge queue Dec 30, 2025
Merged via the queue into master with commit e0e6f70 Dec 30, 2025
38 checks passed
@gregorydemay gregorydemay deleted the gdemay/DEFI-2168-fix-ckdoge-transaction branch December 30, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants