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

'verifymessage' fails for messages signed using segwit address #381

Open
3rror404 opened this issue Oct 2, 2023 · 0 comments
Open

'verifymessage' fails for messages signed using segwit address #381

3rror404 opened this issue Oct 2, 2023 · 0 comments

Comments

@3rror404
Copy link

3rror404 commented Oct 2, 2023

Messages can be signed successfully with both legacy and segwit addresses using the signmessage command, but messages signed with segwit addresses can not be verified with the verifymessage command.

The messages seem to be signed correctly, as can be verified here: https://www.verifybitcoinmessage.com/

Examples

Legacy address

Address: p5iG9HLZoVCMNYCYyYHj4aPBJ6rwiHhg7n
Message: Hello, world!
Signature: H0drZIYwca61ZKCXJ0uEWNgwztgTwbX9Te70K18t8XVeFS8hcNO4fRxi7zpbgR9tbemYF0etnX3ybhqAJfUUTZ8=

Segwit address

Address: pkt1q6sj0mchq7ltwm8c9tpm2wteqmeldr2ye5lcr60
Message: Hello, world!
Signature: IH73zLeFgqeYZL0zSnS0bMbumiwYaiY7521KqrG4rjDKENMhPGJljlTAM86EPqeI4+CnXn7xoHXSMim/OsBPLUo=

Error

{
    "code": -32603,
    "message": "1.6.1 address type not supported",
    "stack": [
        "  btcutil/er/er.go:359 +0x28\t  btcutil/er.New({0x10520ccee, 0x1a})",
        "  pktwallet/rpc/legacyrpc/methods.go:1830 +0x268\t  pktwallet/rpc/legacyrpc.verifyMessage({0x1055a7500?, 0x14001558540}, 0x105708ea0?)",
        "  pktwallet/rpc/legacyrpc/methods.go:174 +0x30\t  pktwallet/rpc/legacyrpc.lazyApplyHandler.func5({0x1055a7500?, 0x14001558540?})",
        "  pktwallet/rpc/legacyrpc/methods.go:154 +0x60\t  pktwallet/rpc/legacyrpc.lazyApplyHandler.lazyApplyHandler.func1.func10()",
        "  pktwallet/rpc/legacyrpc/server.go:602 +0x1cc\t  pktwallet/rpc/legacyrpc.(*Server).postClientRPC(0x14000276780, {0x1057030b0?, 0x140005dcd20}, 0xc?)",
        "  pktwallet/rpc/legacyrpc/server.go:138 +0x268\t  pktwallet/rpc/legacyrpc.NewServer.func2({0x1057030b0, 0x140005dcd20}, 0x14011a25500)",
        "  net/http/server.go:2136 +0x38\t  net/http.HandlerFunc.ServeHTTP(0x14011090a68?, {0x1057030b0?, 0x140005dcd20?}, 0x104bb65dc?)",
        "  pktwallet/rpc/legacyrpc/server.go:342 +0x128\t  pktwallet/rpc/legacyrpc.NewServer.throttledFn.throttled.func4({0x1057030b0?, 0x140005dcd20?}, 0x14011090b08?)",
        "  net/http/server.go:2136 +0x38\t  net/http.HandlerFunc.ServeHTTP(0x14010a7c56c?, {0x1057030b0?, 0x140005dcd20?}, 0x14011090af0?)",
        "  net/http/server.go:2514 +0x144\t  net/http.(*ServeMux).ServeHTTP(0x10?, {0x1057030b0, 0x140005dcd20}, 0x14011a25500)",
        "  net/http/server.go:2938 +0xbc\t  net/http.serverHandler.ServeHTTP({0x105700a48?}, {0x1057030b0?, 0x140005dcd20?}, 0x6?)",
        "  net/http/server.go:2009 +0x518\t  net/http.(*conn).serve(0x1400022fd40, {0x105704538, 0x1400021f2c0})",
        "  net/http/server.go:3086 +0x4cc\t  created by net/http.(*Server).Serve in goroutine 55"
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant