Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KIP-228: Update EIP refs #57

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions KIPs/kip-228.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Semantics of `EXTCODESIZE`, `EXTCODECOPY`, `EXTCODEHASH`, `CALL`, `CALLCODE`, `S

#### Gas costs

The intrinsic gas cost of a SetCode transaction follows the EIP-7702, meaning it inherits [EIP-2930](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2930.md) and [EIP-2028](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2028.md). Note that the EIP-2028 rule is realized by [KIP-223](https://github.com/kaiachain/kips/blob/main/KIPs/kip-223.md).
The intrinsic gas cost of a SetCode transaction follows the EIP-7702, meaning it inherits [EIP-2930](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2930.md) and [EIP-7623](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7623.md). Note that the EIP-7623 rule is realized by [KIP-223](https://github.com/kaiachain/kips/blob/main/KIPs/kip-223.md).

#### Transaction Origination

Expand Down Expand Up @@ -163,19 +163,21 @@ If we choose to select the encoding depending on hardfork instead, then all trie

ValueTransfer transaction types cannot be sent to EOAs with code. Kaia’s ValueTransfer transaction types have the semantics of simply increasing the balance of the destination EOA. If ValueTransfer can target EOA with code, the balance increase would bypass the EOA’s fallback() or receive() function. Opening a way to bypass the fallback may have an unknown security implication, thus prohibiting such a case.

AccountUpdate transaction types cannot be sent to EOAs with code. The reason is the same as why EOAs with updated AccountKeys cannot sign authorization.

SmartContractExecution transaction types can be sent to EOAs with code. Kaia’s SmartContractExecution transaction types had the semantics of executing the code of the destination SCA. Now that EOAs with code has a code, SmartContractExecution transactions indeed can invoke them.

AccountUpdate transaction types cannot be sent to EOAs with code. The reason is the same as why EOAs with updated AccountKeys cannot sign authorization.

## Backwards Compatibility

The stateRoot calculation is backward compatible because we retain the EOA’s compact encoding.

The semantics of Ethereum typed transactions are backward compatible. If the target account has nonempty code, the code is executed.

Some wallets and dapps may want to determine if a given address is contract or not, to select between ValueTransferTx and SmartContractExecutionTx. In this case, they can keep using the `kaia_getAccount` or `kaia_isContractAccount` APIs. If the APIs return an empty code, they must choose ValueTransferTx. Otherwise, the target is contract so they must use SmartContractExecutionTx.

## Implementation

[draft implementation](https://github.com/kaiachain/kaia/tree/feat/eip-7702)
[implementation](https://github.com/kaiachain/kaia/tree/v2.0.0-rc.5)

## References

Expand Down
Loading