Skip to content

fix(tokens): wallet asset handling, reserved tickers and BDX input asset checks - #244

Merged
victor-tucci merged 8 commits into
Beldex-Coin:feature-privacy-tokenfrom
victor-tucci:feature-privacy-token
Dec 2, 2026
Merged

victor-tucci merged 8 commits into
Beldex-Coin:feature-privacy-tokenfrom
victor-tucci:feature-privacy-token

Conversation

@victor-tucci

Copy link
Copy Markdown
Member

No description provided.

julie882 and others added 8 commits December 1, 2026 17:08
Reject token inputs when constructing BDX transactions to
prevent cross-asset input selection.
The ring-assembly side of get_outs gated each saved ring member with
`out < num_outs`, comparing the member's real global output index against
num_outs, which on the rct path is a per-asset bucket count, not an index
bound. Native and token rct outputs share one global index space while that
count is per asset, so saved members were almost always dropped and the ring
refilled with fresh random decoys. Re-spending a key image then produced a
different ring for the same key image, and intersecting the two reveals the
real output.

Reuse a saved member iff it is one of the outputs actually requested for the
input (the request list is seeded from the same saved ring), matching the
request-building side, so the assembled ring equals the saved ring. Drop the
per-asset num_outs recomputation that only fed the broken comparison.
Enforce asset type validation for BDX transaction inputs
on_unconfirmed_money_received carried only an amount, so the CLI formatted
a pending privacy-token payment as BDX. The callback now carries the token
id and the CLI formats the amount with it.

The wallet currently fetches only flash transactions from the pool, so this
path is not reached for incoming payments today; the change keeps it correct
if non-flash pool scanning is ever enabled.
create_transactions_2 fed destinations to the selection loop in their original
order, but the loop only applies a picked input's leftover value to a run of
consecutive same-asset destinations. A token destination between native ones
cut the native run short, so a single large native input paid only the first
recipient and its remainder was discarded, exhausting the wallet mid-batch and
failing with "Failed to find a way to create transactions" despite ample
balance. Stable-sort destinations by token id (native first) so each asset's
recipients are contiguous and one input can pay them all; skipped when
subtract_fee_from_outputs indexes destinations.

Also broaden the bulletproof+ output-count guard in transfer_selected_rct from
token-only to every transaction, before and after construction, so a transfer
to more than TX_BULLETPROOF_PLUS_MAX_OUTPUTS (16) recipients fails with a clear
message instead of an opaque "invalid bulletproofs_plus" rct serialization
error.
fix(wallet): reuse saved rings on re-spend, and fix mixed-asset transfer construction
@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8a7d3c2a-3396-4f64-89fc-07f13ebb59dd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@victor-tucci
victor-tucci merged commit de7c523 into Beldex-Coin:feature-privacy-token Dec 2, 2026
2 checks passed
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.

3 participants