-
Notifications
You must be signed in to change notification settings - Fork 8
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
Expand Low Level Shutter Spec #28
Conversation
This closes a malleability vulnerability.
shutter/low-level.md
Outdated
|
||
#### eth_sendRawTransaction | ||
|
||
The server exposes a method `eth_sendRawTransaction` that behaves differently to the standard. It takes a hex encoded, `0x` prefixed string `h` as its sole parameter. If not exactly one parameter is provided, the server responds with an error with code `-32602`. If `h` is not the hex encoding of a byte string `b` or `b` is not the RLP encoding of a valid transaction `tx`, it returns an error with code `-32602`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use regular names instead of single letters h
, b
, s
? Should make it a little more readable.
shutter/low-level.md
Outdated
|
||
If the sender of `tx` has insufficient funds to pay the transaction fee or if the sender's nonce does not match the account nonce, the server responds with an error with code `-32000`. | ||
|
||
Upon receiving the request, the server seeks the eon key `eon_key = getEonKey(eon)` with `eon = keyperSetManager.getKeyperSetIndexBySlot(s + keyper_set_change_lookahead)` where `s` is the current slot number. It also generates two random 32 byte strings `sigma` and `identity_prefix` using a cryptographically secure random number generator. Based on these values, it computes `encrypted_transaction = encrypt(b, identity, eon_key, sigma)` with `identity = compute_identity(identity_prefix, address)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the caller of eth_sendRawTransaction
specify the slot at which to encrypt the transaction at? Or the point is to have the same API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the point is to have the exact same API so that the encrypting RPC server can be a drop-in replacement. Also, there is no target slot number anymore, transactions get decrypted and included whenever there's space (see the get_next_transactions
function).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Quite straightforward and complete, just some minor comments.
Can you detail more the malleability vulnerability addressed by the PR?
Sure! The way the encryption works in the end is by XORing the message with a symmetric key (see To prevent this, there's a kind of checksum in the encrypted message, which includes the hash of the encrypted message ( Now, for Shutterized Gnosis Chain all this doesn't technically matter since all we encrypt is signed messages, so all malleability attempts would simply result in invalid signatures. But obviously it's still better to fix it anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments! Looks good to me
This PR expands
/shutter/low-level.md
. In particular, itencode_gt
function, the last missing crypto function.