Skip to content

wallet: complete hot-cold implementation for Carrot/FCMP++#52

Open
jeffro256 wants to merge 1 commit intoseraphis-migration:fcmp++-stagefrom
jeffro256:fcmp++-stage-cold-hot
Open

wallet: complete hot-cold implementation for Carrot/FCMP++#52
jeffro256 wants to merge 1 commit intoseraphis-migration:fcmp++-stagefrom
jeffro256:fcmp++-stage-cold-hot

Conversation

@jeffro256
Copy link
Copy Markdown
Collaborator

@jeffro256 jeffro256 commented Jun 1, 2025

Carrot/FCMP++ hot-cold wallets

Design goals

Protocol goals

  • Compact exported Carrot outputs format
  • Compact signed Carrot/FCMP++ transaction format (SA/L's and key image associations only)
  • Deferred FCMP / BP+ proving to hot wallets at time of submission
  • Allows for "state-less" transaction proposals and signing
  • Allows for state-less, cold-initiated transaction proposals
  • Allows for hot-cold setups for Carrot-key-hierarchy wallets
  • Allows hiding of sender-receiver secrets from hot wallet

Wallet implementation goals

  • New hot wallets backwards compatible with old cold wallets until FCMP++ hard fork activation
  • New cold wallets backwards compatible with old hot wallets until FCMP++ hard fork activation
  • User experience for hot-cold setups on CLI and RPC is unchanged before and after FCMP++ hard fork activation
  • Wallet RPC interface completely backwards compatible until FCMP++ hard fork activation
  • Wallet RPC interface only differs in fetching of transaction secret keys after FCMP++ hard fork activation

Testing

  • Importing/exporting outputs, subaddress and coinbase included
  • Carrot-key-hierarchy account signing
  • State-less transaction proposals and signing
  • Cold-initiated transaction proposals

New quirks

  • Sender-receiver secrets for Carrot/FCMP++ transactions now need to fetched by the signable transaction hash, not TXID, from the cold wallet. The hot wallet RPC returns the signable transaction hash in the submit_transfer method. This is a breaking change.
  • Because finalizing transaction proposals into pruned Carrot/FCMP++ transactions requires knowing the private view-incoming key, a hot wallet without a differing private view-incoming key will cryptographically not be able to submit a signed transaction set. This shouldn't be a breaking change since the signed transaction payloads are encrypted using the private view-incoming key anyways.

Depends: #74, #75, #76, #77, #97, #98, #214, #216, #296

Will break this PR up into smaller pieces once the above are merged.

@jeffro256 jeffro256 marked this pull request as draft June 1, 2025 04:03
@j-berman j-berman mentioned this pull request Jun 5, 2025
75 tasks
@jeffro256
Copy link
Copy Markdown
Collaborator Author

jeffro256 commented Jun 5, 2025

Legacy cold_signing tests pass now (hard-fork table not updated). Also, src/wallet2.* are about ~1500 lines smaller ;)

@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch from 7153239 to bad06a9 Compare June 6, 2025 21:45
@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch 3 times, most recently from d86ae71 to 1e7fc6a Compare July 8, 2025 20:16
@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch from 1e7fc6a to 805a504 Compare July 22, 2025 05:28
const std::size_t prefix_size = magic_size + 1;
THROW_WALLET_EXCEPTION_IF(payload.size() <= prefix_size,
error::wallet_internal_error, "outputs payload too short");
THROW_WALLET_EXCEPTION_IF(memcmp(payload.data(), KEY_IMAGE_EXPORT_FILE_MAGIC.data(), magic_size),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OUTPUT_EXPORT_FILE_MAGIC

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thank you

@jeffro256 jeffro256 changed the title wallet: finsih implementing and testing hot/cold wallet cryptography wallet: complete hot-cold implementation for Carrot/FCMP++ Jul 23, 2025
@ComputeryPony
Copy link
Copy Markdown

ComputeryPony commented Jul 24, 2025

Not sure if it's just not implemented yet or a bug but I can almost make and use an offline wallet with this PR but I get an error when running submit_transfer at the very end.

[wallet 55WeP6]: submit_transfer
Error: unexpected error: std::get: wrong index for variant

@jeffro256
Copy link
Copy Markdown
Collaborator Author

@ComputeryPony thanks for bringing that up, it was a bug. Does the latest commit fix it? It seems to work for me now

@ComputeryPony
Copy link
Copy Markdown

@ComputeryPony thanks for bringing that up, it was a bug. Does the latest commit fix it? It seems to work for me now

Yup, that fixed it. Thanks!

@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch from ae24a60 to bb915d9 Compare July 25, 2025 00:34
@jeffro256
Copy link
Copy Markdown
Collaborator Author

Rebased against fcmp++-stage and remove usage of tools::add_element().

@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch 3 times, most recently from 59da132 to 03f9632 Compare September 8, 2025 22:01
@jeffro256
Copy link
Copy Markdown
Collaborator Author

Rebased

@jeffro256
Copy link
Copy Markdown
Collaborator Author

Rebased

@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch 2 times, most recently from d976f5f to 0359592 Compare February 25, 2026 20:32
@jeffro256
Copy link
Copy Markdown
Collaborator Author

Reworked to incorporate unbiased hash-to-point changes.

@jeffro256
Copy link
Copy Markdown
Collaborator Author

Unit test failure is unrelated

@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch from 0359592 to 0772894 Compare February 26, 2026 20:32
@jeffro256
Copy link
Copy Markdown
Collaborator Author

Rebased due to #296

@jeffro256 jeffro256 force-pushed the fcmp++-stage-cold-hot branch from c8da52d to ec68a53 Compare March 10, 2026 14:31
@jeffro256
Copy link
Copy Markdown
Collaborator Author

Rebased due to fcmp++-stage rebase against master

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.

2 participants