A Solidity implementation of ERC-5564 stealth addresses for offchain usage based on crysol
.
StealthAddresses
is a library for common stealth address operations. Note that most of the functionality is vmed
, meaning it is only executable offchain.
See script/Example.s.sol
for usage example.
$ forge script script/Example.s.sol
> [ALICE] Created new address funded with 1 ETH
> [BOB] Created two key pairs for their stealth meta address
> [BOB] Created and published stealth meta address: st:eth:0x030403...18c1e
> [ALICE] Generated stealth address from Bob stealth meta address
> [ALICE] Send 1 ETH to stealth address and published the stealth address
> [BOB] Found out the stealth address belongs to them
> [BOB] Computed the stealth address' secret key
Install with Foundry:
$ forge install verklegarden/stealth-addresses
The project uses the Foundry toolchain. You can find installation instructions here.
Setup:
$ git clone https://github.com/verklegarden/stealth-addresses
$ cd stealth-addresses/
$ forge install
Run tests:
$ forge test
$ forge test -vvvv # Run with full stack traces
$ FOUNDRY_PROFILE=intense forge test # Run in intense mode
Lint:
$ forge fmt [--check]
This is experimental software and is provided on an "as is" and "as available" basis.
We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.