Commit graph

1 commit

Author SHA1 Message Date
Arran Schlosberg
1ec8741af9
feat: ethtest.UNSAFEDeterministicPrivateKey() (#244)
## Why this should be merged

The ability to deterministically generate private keys (and
corresponding EOAs) is useful in testing.

## How this works

A `[]byte` seed is written to a Keccak state, which is rejection-sampled
to find a scalar `<` the order of `S256` to use as the private key.

## How this was tested

Unit test that demonstrates (a) determinism of generation; and (b)
correct computation of the public key as proven by ECDSA recovery using
the standard tx-sender functionality.
2025-11-12 18:29:15 +00:00