Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
Background
ERC-2470 proposes a factory that uses CREATE2 to deploy contracts at the same address on multiple blockchains.
This article explains and expands on the proposal below.
I also cover other EIPs here.
Overview
Some decentralized applications rely on a singleton contract with one known address across chains. Global infrastructure such as the registries described in ERC-1820 and ERC-2429 is particularly sensitive to address consistency because many projects refer to the same interface or registry.
For more on ERC-1820, see the following article.
[ERC-1820] How a Solidity update fixed the ERC-820 issue
ERC-2470 proposes a permissionless CREATE2 factory. The factory address, contract initialization code, and salt determine the deployed address. Repeating the same inputs from the same factory gives the same address, subject to the destination chain supporting the required operations and the deployment succeeding.
For background on CREATE2, see the following reference.
The factory itself is deployed using Nick's method, which constructs a transaction whose recovered sender is a single-use account with no known private key. The same deployment transaction can create the factory at the same address on compatible chains.
Developers can use the factory to keep the addresses of shared contracts such as ERC-1820 registries consistent across development networks, testnets, and mainnet. A common address simplifies integration and code reuse.
Nick's method
Ordinary transaction signatures and ecrecover
An Ethereum transaction does not explicitly include its from address. Signature recovery derives the public key from the signing hash and signature, and hashing the public key gives the corresponding address. In normal use, a sender with the private key generates the signature.
Choosing signature values without a known private key
The technique reverses the usual process. It chooses recoverable signature values v, r, s for a particular transaction, then derives the sender. Arbitrary values can be invalid, but a recoverable combination normally yields a sender address whose private key is unknown. Funding that sender allows execution of the prepared transaction without providing a reusable signing key.
Funding a single-use address
- Construct the transaction using chosen signature values, such as a recognizable
0xDA0DA0DA0...pattern. Their choice makes the construction reproducible. - Recover the sender address from the transaction.
- Send Ether to that address.
- Broadcast the prepared transaction. The funds are usable for that transaction under the assumption that nobody knows the corresponding private key.
Applying the same technique to a batch payout
The linked extraBalance multisend example prepares a group of transactions with 110 recipients each, using 104 transactions in the example. Each transaction has a single-use sender. A root transaction, itself using a single-use sender, supplies Ether to the addresses that fund the group.
The trustees fund the root address, then the already verified transactions execute in sequence to pay the recipients. The funding party needs to sign once, and the unknown keys are intended to prevent participants from redirecting the funds.
Benefits
- No private key to manage. The single-use accounts have no known signing keys.
- Reproducibility. The fixed inputs let anyone recompute the sender addresses.
- Transparency. Parties can verify the recipients and amounts before funding.
- Efficiency. A large payout can be initiated with one signed funding transaction.
Worked example
The following steps explain how signature recovery produces a single-use sender.
1. Signature fields
vis the recovery identifier, which helps select the appropriate curve solution.ris derived from the x-coordinate of an elliptic-curve point.sis the other ECDSA signature scalar.
These values are normally calculated using a private key.
2. Recovering an address
- Supply the message hash and the signature
v, r, s. - Recover the public key. The recovery identifier helps select the curve point.
- Hash the recovered public key with Keccak-256 and take the last 20 bytes.
- Return the resulting Ethereum address.
Ethereum can derive a transaction sender from its signature, so a separate from field is unnecessary.
3. How Nick's method uses recovery
Instead of signing with a known key, the method chooses values for v, r, s and recovers the sender from them. The result behaves like an unpredictable address with an unknown key. If the signature recovers successfully and the sender is funded, the network can accept the prepared transaction.
4. Why some choices are recoverable
The ECDSA scalars must be in range. Recovery also requires the candidate x-coordinate to correspond to a point on the curve. A randomly chosen candidate has roughly a 50% chance of satisfying that condition, which the method uses to find suitable values.
5. Simplified calculation
First choose signature values.
v = 27
r = 0xDA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA
s = 0xDA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DA0DAThe Japanese article illustrates the hashing step with the following expression.
hash = keccak256(rlpEncode(nonce, gasPrice, gasLimit, to, value, data, v, r, s))That expression hashes the signed transaction encoding, which is used for the transaction hash. Sender recovery for a legacy transaction without EIP-155 instead hashes the RLP encoding of the six unsigned fields: nonce, gas price, gas limit, recipient, value, and data. The signature fields are supplied separately to the recovery operation.
pubkey = ECDSA_recover(hash, v, r, s)
address = keccak256(pubkey)[12:] // 末尾20バイトThe address below is the sender recovered for the ERC-2470 factory's actual deployment transaction. It is not derived from the illustrative signature values above.
0xBb6e024b9cFFACB947A71991E386681B1Cd1477DThe resulting deployment account is single-use because its private key is unknown.
6. Using the single-use sender
- Construct the transaction with fixed
v, r, s. - Recover the sender address.
- Fund that address with Ether.
- Broadcast the prepared transaction so it spends those funds for the intended operation.
- With no known key, the sender cannot ordinarily be used to authorize another transaction.
https://weka.medium.com/how-to-send-ether-to-11-440-people-187e332566b7
Motivation
The factory makes shared contracts easier to deploy and reuse. Any caller can use the same mechanism, which simplifies deployments for projects that depend on one consistent contract address across multiple chains.
Specification
The ERC-2470 Singleton Factory exposes EIP-1014's CREATE2 instruction for deploying contracts at predictable addresses.
EIP-1014 defines the underlying CREATE2 operation.
Nick's method is used to deploy the factory itself. Reusing the same single-use account and deployment transaction yields the same factory address on each compatible chain.
Interface
pragma solidity 0.6.2;
/**
* @title Singleton Factory (EIP-2470)
* @notice Exposes CREATE2 (EIP-1014) to deploy bytecode on deterministic addresses based on initialization code and salt.
* @author Ricardo Guilherme Schmidt (Status Research & Development GmbH)
*/
contract SingletonFactory {
/**
* @notice Deploys `_initCode` using `_salt` for defining the deterministic address.
* @param _initCode Initialization code.
* @param _salt Arbitrary value to modify resulting address.
* @return createdContract Created contract address.
*/
function deploy(bytes memory _initCode, bytes32 _salt)
public
returns (address payable createdContract)
{
assembly {
createdContract := create2(0, add(_initCode, 0x20), mload(_initCode), _salt)
}
}
}
// IV is a value changed to generate the vanity address.
// IV: 6583047Deployment details
-
Common factory address
text0xce0042B868300000d44A59004Da54A005ffdcf9f -
Single-use deployment account with no known private key
text0xBb6e024b9cFFACB947A71991E386681B1Cd1477D -
Funding requirement: 0.0247 ETH, based on the gas limit and gas price.
-
Deployment transaction hash
text0x803351deb6d745e91545a6a3e1c0ea3e9a6a02a1a4193b70edfcd2f40f71a01c
deploy
function deploy(bytes memory _initCode, bytes32 _salt)
public
returns (address payable createdContract)Deploys a contract using initialization code and a salt. The resulting address depends on the factory address, initialization code, and salt. The same inputs give the same address across chains that have the same factory.
Parameters
_initCode- Initialization code of the contract to deploy.
_salt- Arbitrary 32-byte value that affects the deployment address.
Return value
createdContract- Address returned by the contract creation operation.
SingletonFactory
contract SingletonFactory {
function deploy(bytes memory _initCode, bytes32 _salt)
public
returns (address payable createdContract)
{
assembly {
createdContract := create2(0, add(_initCode, 0x20), mload(_initCode), _salt)
}
}
}Any caller can use the factory to deploy shared contracts at consistent addresses, as needed by standards such as ERC-1820 and ERC-2429. This simplifies cross-chain dapps and infrastructure built around a shared address.
Deployment procedure
Keyless deployment uses a transaction with recoverable signature parameters but no known private key for the derived sender. Reusing the prepared transaction allows the factory to be deployed at the same address on compatible chains.
How keyless deployment works
A conventional deployment transaction is authorized by an externally owned account. With Nick's method, the construction starts with fixed signature parameters. After funding the recovered account, anyone can broadcast the prepared deployment transaction.
Why it does not use EIP-155
EIP-155 includes a chain ID in the signing hash. That makes the signature valid for its intended chain rather than reusable across chains. ERC-2470 uses a legacy transaction so that compatible chains can derive the same sender and repeat the deployment.
Transaction parameters
nonce: 0- First transaction from the single-use deployment account.
gasPrice: 100000000000(100 Gwei)- Fixed price per gas unit, set high for inclusion on the networks contemplated by the proposal.
gasLimit: 247000- Maximum gas to consume, chosen at about twice the anticipated use to accommodate changes in opcode pricing.
value: 0- Sends no Ether to the created contract.
data: <long hexadecimal string>- Factory deployment bytecode.
v: 27, r: 0x247000, s: 0x2470- Fixed signature fields. The recognizable
2470values make the construction easier to inspect. In combination with the transaction fields, they determine the recovered sender.
- Fixed signature fields. The recognizable
The single-use deployment account
Recovering the sender from the transaction fields and signature gives 0xBb6e024b9cFFACB947A71991E386681B1Cd1477D. Nobody is assumed to know the corresponding private key.
Required ETH and the unused balance
At 100 Gwei and a gas limit of 247000, the maximum cost is 0.0247 ETH. The example leaves about 0.01 ETH unused. That remainder stays at the single-use address because the key is unknown and no further usable transaction has been prepared. The surplus is the cost of funding the deployment with a margin for gas changes.
Broadcasting and verifying the result
Broadcast the prepared transaction as-is. Its transaction hash is 0x803351deb6d745e91545a6a3e1c0ea3e9a6a02a1a4193b70edfcd2f40f71a01c. Where the transaction is accepted, the same factory code is deployed.
Reproducing the address across chains
The deployment account and nonce are the same, so the resulting factory address is 0xce0042B868300000d44A59004Da54A005ffdcf9f. This makes it easier to write code and documentation that refer to one address across chains.
Procedure at a glance
- Prepare the transaction using
nonce:0, gasPrice:100 Gwei, gasLimit:247000, value:0, data:<bytecode>, v=27, r=0x247000, s=0x2470. - Recover the single-use sender and verify that it is
0xBb6e...477D. - Send
0.0247ETH to the single-use account. - Broadcast the prepared deployment transaction.
- Verify the factory at
0xce0042...cf9fon the destination chain.
Design considerations
- Leaving out EIP-155 allows the same legacy signature to be reused across compatible chains.
- The
247000gas limit gives the deployment a margin for opcode repricing. Any unused funds remain at the single-use address. - The chosen
randsvalues determine a sender through signature recovery without deriving the signature from a known key. - The account is intended for one deployment per chain because nobody knows its private key.
ABI
[
{
"constant": false,
"inputs": [
{
"internalType": "bytes",
"name": "_initCode",
"type": "bytes"
},
{
"internalType": "bytes32",
"name": "_salt",
"type": "bytes32"
}
],
"name": "deploy",
"outputs": [
{
"internalType": "address payable",
"name": "createdContract",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]Additional notes
The Singleton Factory passes zero as the value argument to create2. Otherwise, the deployer could supply different amounts of Ether on different chains even when the resulting contract address was the same.
Callers can choose a salt, including one selected to produce a vanity address. If no salt is needed, use an all-zero bytes32 value.
A contract constructor must not assume that msg.sender is the intended owner or initializer when deployed through the factory. It is the factory address. Pass initialization values as constructor arguments or use an explicit initialization function.
The deployment address can be calculated as follows.
address(keccak256(0xff ++ factory_address ++ salt ++ keccak256(init_code))[12:])The source also gives this more concrete expression.
address(keccak256(bytes1(0xff), 0xce0042B868300000d44A59004Da54A005ffdcf9f, _salt, keccak256(_code)) << 96)In JavaScript, the ethereumjs-util library's generateAddress2 function performs the same calculation.
Security Considerations
Some contracts should be deployed only on specific chains or should use a different address on each chain. EIP-1344 allows a constructor to inspect the chain ID so it can apply the appropriate rules. If the address itself needs to differ, the chain ID can be included in an input such as the salt or initialization code.
For more on EIP-1344, see the following article.
[EIP-1344] The opcode that returns the chain ID
A wallet-related account can act as a singleton for its user. EIP-1191 specifies a chain-aware address checksum convention that such wallets can use when representing addresses.
For more on EIP-1191, see the following article.
[ERC-1191] How Ethereum address checksums can incorporate chain IDs
Do not assign ownership to msg.sender in constructors run through the factory. The factory would become the owner or administrator of each deployed instance. Pass the intended owner explicitly instead.
Citation
Ricardo Guilherme Schmidt (@3esmit), "ERC-2470: Singleton Factory [DRAFT]," Ethereum Improvement Proposals, no. 2470, January 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2470.
Conclusion
ERC-2470 proposes a shared factory for CREATE2 deployments. The factory makes it possible to place contracts at consistent addresses across multiple compatible chains.
Questions are welcome via direct message.
You can find more of my work at these links.



