BeamMW / beam

Beam: Scalable Confidential Cryptocurrency. Leading the way to Confidential DeFi
https://beam.mw
Apache License 2.0
699 stars 202 forks source link

FR: signing/verifying a message #1969

Open Maxnflaxl opened 2 months ago

Maxnflaxl commented 2 months ago

Feature title:

Signing/verifying a message

Technical implementation:

@valdok

Describe the solution you'd like

sign a message with CLI: ./beam-wallet sign_message --address=<address> --message=<message> ? If the --address argument is missing, use default address. ? If the --message argument is missing, only want to prove ownership of an address. => returns signature

verify a message with CLI: ./beam-wallet verify_message --address=<address> --message=<message> --signature=<signature> => successful: Good signature from <address> => fail: Invalid signature from <address>

sign a message with wallet-api:

-->

{
    "jsonrpc":"2.0", 
    "id": <TBD>,
    "method":"sign_message",
    "params":
    {
        "address" : "",
        "message" : "",
    }
}

<--

{
    "jsonrpc":"2.0", 
    "id": <TBD>,
    "result":
    {
        "signature" : ""
    }
}

verify a message with wallet-api:

-->

{
    "jsonrpc":"2.0", 
    "id": <TBD>,
    "method":"verify_message",
    "params":
    {
        "address" : "",
        "message" : "",
        "signature": ""
    }
}

<--

{
    "jsonrpc":"2.0", 
    "id": <TBD>,
    "result":
    {
        "signature" : ""
    }
}

Additional context https://github.com/BeamMW/beam-ui/issues/1066 https://github.com/BeamMW/beam/wiki/Beam-wallet-protocol-API-v7.3 https://beam.mw/docs/cli