Matching addresses
Deploying with the salt
The contract address depends only on the network, the deployer address and the salt. The WASM code and the constructor arguments do not change it. Deployment needs the deployer's authorization, so nobody else can take the address, and the salt does not have to be kept secret. Each salt works once per deployer and network.
Stellar CLI
JavaScript SDK
Factory contract (Rust)
How it works
- A contract address is the SHA-256 hash of the network ID, the deployer address and a 32-byte salt chosen at deployment, encoded as a 56-character base32 string. The generator tries random salts until the address matches.
- A salt and its address belong to one network. The network ID is part of the hash, so a salt found for Testnet gives a different contract address on Mainnet, and the other way round.
- Each base32 character takes one of 32 values, so every character you add makes the search 32 times longer. The second character only takes 4 values (A–D), so it makes the search 4 times longer.
- The search uses one Web Worker per selected thread. More workers than CPU cores do not make it faster, and leave less CPU time for other programs.
- Every match is checked again with the browser's built-in WebCrypto SHA-256 before it is marked as verified.
Same search from the command line: node contract-vanity.js <deployer> --prefix CA… --suffix …
(source code and CLI on GitHub)