-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
4844: use hash_tree_root
for tx hash
#6385
Conversation
All tests passed; auto-merging...(pass) eip-4844.md
|
Strongly support going in this direction. We have a medium-term goal of moving transactions as a whole away from RLP and Merkle Patricia trees to SSZ, and The main downside that I see is that this will break some infrastructure that depends on |
The signed hash must be protected against malleability In this example, both type
Foo = object
a: uint64
b: uint64
c: uint64
Bar = object
a: uint64
b: uint64
c: uint64
d: uint64
let
foo = Foo(
a: 0x42,
b: 0x42,
c: 0x42)
bar = Bar(
a: 0x42,
b: 0x42,
c: 0x42,
d: 0)
debug "Foo", f = toHex(hash_tree_root(foo).data)
debug "Bar", f = toHex(hash_tree_root(bar).data) The transaction hash should be perpetually stable and unique. In consensus, there is Overall, the solution should be compatible with whatever we are deciding during ethereum/pm#721 regarding the overarching SSZ As for security, if we decide to mix |
This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction.
This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction.
This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction.
Attempt to fix malleability: #6493 |
This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction.
This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction.
Thanks @etan-status I understand the issue with malleability now. I will close this in favor of #6493 |
* Update EIP-4844: `hash_tree_root` based transaction hashes This PR builds on top of prior work from: - @lightclient at #6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction. * Fix `signed_tx_hash` * Use static chain ID for purpose of domain computation * Extract SSZ signature scheme to EIP for reuse * Add URL * Split 4844 changes to separate PR * Fix * rm redundant test * Apply most of @g11tech's review Co-authored-by: g11tech <[email protected]> --------- Co-authored-by: Gavin John <[email protected]> Co-authored-by: g11tech <[email protected]>
* Update EIP-4844: `hash_tree_root` based transaction hashes This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction. * Fix `signed_tx_hash` * Use static chain ID for purpose of domain computation * Extract SSZ signature scheme to EIP for reuse * Add URL * Split 4844 changes to separate PR * Fix * rm redundant test * Apply most of @g11tech's review Co-authored-by: g11tech <[email protected]> --------- Co-authored-by: Gavin John <[email protected]> Co-authored-by: g11tech <[email protected]>
* Update EIP-4844: `hash_tree_root` based transaction hashes This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction. * Fix `signed_tx_hash` * Use static chain ID for purpose of domain computation * Extract SSZ signature scheme to EIP for reuse * Add URL * Split 4844 changes to separate PR * Fix * rm redundant test * Apply most of @g11tech's review Co-authored-by: g11tech <[email protected]> --------- Co-authored-by: Gavin John <[email protected]> Co-authored-by: g11tech <[email protected]>
* Update EIP-4844: `hash_tree_root` based transaction hashes This PR builds on top of prior work from: - @lightclient at ethereum#6385 The signature malleability issue in the original PR is addressed by reusing the consensus `compute_signing_root` mechanism to link each hash with the transaction's underlying `chain_id` and `tx_type`. Note that this makes the transaction hashes different from the plain `hash_tree_root` values. This means that if the `transactions_root` MPT is replaced with SSZ (EIP-6404), that the `transaction_hash` would need to be tracked separately, same as for legacy RLP-based transactions. This is mainly a cosmetic issue, not a practical one. In an SSZ tx tree, we could simply include both the HTR as well as the perpetual tx hash. Cryptographic analysis may be necessary to determine the amount by which the hash collision probability is increased, if we use different hashing algorithms for transactions. On the other hand, using different algo for SSZ transactions reduces the impact of a custom network defining 0x05 as a RLP transaction that might serialize same as the blob SSZ transaction. * Fix `signed_tx_hash` * Use static chain ID for purpose of domain computation * Extract SSZ signature scheme to EIP for reuse * Add URL * Split 4844 changes to separate PR * Fix * rm redundant test * Apply most of @g11tech's review Co-authored-by: g11tech <[email protected]> --------- Co-authored-by: Gavin John <[email protected]> Co-authored-by: g11tech <[email protected]>
I think we should move to
hash_tree_root
for calculating the transaction hash of 4844 transactions if we plan to migrate to an SSZ list of transactions.The reason for staying with (and originally choosing) keccak is that it fits nicely into the expectation that the MPT hashing algorithm has for leaves greater than 32 bytes, it will simply take the keccak of it.