diff --git a/ethergo/signer/signer/localsigner/signer.go b/ethergo/signer/signer/localsigner/signer.go index 6b3e0c7ffc..aed7e6fea0 100644 --- a/ethergo/signer/signer/localsigner/signer.go +++ b/ethergo/signer/signer/localsigner/signer.go @@ -56,7 +56,7 @@ func decodeSignature(sig []byte) signer.Signature { if len(sig) != crypto.SignatureLength { panic(fmt.Sprintf("wrong size for signature: got %d, want %d", len(sig), crypto.SignatureLength)) } - v := new(big.Int).SetBytes([]byte{sig[64]}) + v := new(big.Int).SetBytes([]byte{sig[64] + 27}) r := new(big.Int).SetBytes(sig[:32]) s := new(big.Int).SetBytes(sig[32:64]) diff --git a/ethergo/signer/signer/signer.go b/ethergo/signer/signer/signer.go index d3e1aa1cf6..cfd1c4fdc9 100644 --- a/ethergo/signer/signer/signer.go +++ b/ethergo/signer/signer/signer.go @@ -85,7 +85,7 @@ func DecodeSignature(sig []byte) Signature { } r := new(big.Int).SetBytes(sig[:32]) s := new(big.Int).SetBytes(sig[32:64]) - v := new(big.Int).SetBytes([]byte{sig[64]}) + v := new(big.Int).SetBytes([]byte{sig[64] + 27}) return NewSignature(v, r, s) }