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 keyInstall with Foundry:
$ forge install verklegarden/stealth-addressesThe project uses the Foundry toolchain. You can find installation instructions here.
Setup:
$ git clone https://github.com/verklegarden/stealth-addresses
$ cd stealth-addresses/
$ forge installRun tests:
$ forge test
$ forge test -vvvv # Run with full stack traces
$ FOUNDRY_PROFILE=intense forge test # Run in intense modeLint:
$ 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.