Skip to content

refactor: remove RandomCoin#2223

Open
juan518munoz wants to merge 2 commits into
nextfrom
jmunoz-remove-random-rpo-coin
Open

refactor: remove RandomCoin#2223
juan518munoz wants to merge 2 commits into
nextfrom
jmunoz-remove-random-rpo-coin

Conversation

@juan518munoz

@juan518munoz juan518munoz commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

We are currently investigating whether it's possible to remove custom randomness from crypto:

Why do we have our own Rng traits? Can't we implement Rng from rand on types directly?

0xMiden/crypto#1025 (comment)

Part of this effort is to see if the client can get away without it. In this PR two things are important in that respect:

  1. We can replace RandomCoin with a client's own struct: DefaultFeltRng (ChaCha20).
  2. Yet we still depend on the FeltRng trait itself, as some signatures need to satisfy it (note creation and TransactionRequestBuilder take impl FeltRng). For this we'd need to replace the places where FeltRng is required with something more generic like Rng, which implies making changes to both protocol and node*.
  • biggest setback about this is the need of switching back node's protocol dependency to next, which would bring breaking changes to devnet (thus postponed momentarily).

Tackles #2204

@juan518munoz juan518munoz force-pushed the jmunoz-remove-random-rpo-coin branch from 0daee9c to e50491d Compare June 17, 2026 16:15
@juan518munoz juan518munoz marked this pull request as ready for review June 18, 2026 13:04
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