internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940)
This commit includes several API changes: - The behavior of eth_sign is changed. It now accepts an arbitrary message, prepends the well-known string \x19Ethereum Signed Message:\n<length of message> hashes the result using keccak256 and calculates the signature of the hash. This breaks backwards compatability! - personal_sign(hash, address [, password]) is added. It has the same semantics as eth_sign but also accepts a password. The private key used to sign the hash is temporarily unlocked in the scope of the request. - personal_recover(message, signature) is added and returns the address for the account that created a signature.
Showing
- accounts/abi/bind/auth.go 1 addition, 1 deletionaccounts/abi/bind/auth.go
- accounts/account_manager.go 20 additions, 5 deletionsaccounts/account_manager.go
- common/bytes.go 1 addition, 1 deletioncommon/bytes.go
- common/registrar/ethreg/api.go 1 addition, 1 deletioncommon/registrar/ethreg/api.go
- console/bridge.go 38 additions, 0 deletionsconsole/bridge.go
- console/console.go 7 additions, 4 deletionsconsole/console.go
- core/types/block_test.go 1 addition, 1 deletioncore/types/block_test.go
- core/types/transaction.go 4 additions, 2 deletionscore/types/transaction.go
- core/types/transaction_test.go 1 addition, 1 deletioncore/types/transaction_test.go
- crypto/crypto.go 33 additions, 4 deletionscrypto/crypto.go
- crypto/crypto_test.go 29 additions, 6 deletionscrypto/crypto_test.go
- internal/ethapi/api.go 72 additions, 7 deletionsinternal/ethapi/api.go
- internal/web3ext/web3ext.go 12 additions, 1 deletioninternal/web3ext/web3ext.go
Loading
Please register or sign in to comment