Skip to content

#1969: signing/verifying a message and explorer parser typo#2036

Open
Maxnflaxl wants to merge 5 commits into
boost-1.90from
issue/1969
Open

#1969: signing/verifying a message and explorer parser typo#2036
Maxnflaxl wants to merge 5 commits into
boost-1.90from
issue/1969

Conversation

@Maxnflaxl

@Maxnflaxl Maxnflaxl commented Apr 12, 2026

Copy link
Copy Markdown
Member

Summary

Adds message signing & verification (#1969): a wallet can sign an arbitrary
message with one of its own addresses to prove ownership, and anyone can verify
that signature against the address. Exposed on both the wallet CLI and the
wallet API (v7.4). Also fixes an explorer parser typo.

Wallet CLI

command description
sign_message --message "<msg>" [--address <addr|*>] Sign <msg> with one of your own addresses (--address defaults to *, the wallet's default address). Reads the signing key from the wallet, so it needs the wallet DB — but no node. Prints Signature: (hex) and Address: (the SBBS WalletID) to hand to the verifier.
verify_message --address <WalletID> --message "<msg>" --signature <hex> Verify a signature against an address. Needs neither the wallet DB nor a node — it's pure signature math, so it runs fully offline. Prints Good signature from … / Invalid signature from … and sets the exit code.

Wallet API (v7.4)

  • sign_message — reworked to sign with an own address: param address
    (preferred) instead of raw key material. The old key_material param is still
    accepted for backward compatibility (deprecated); if neither is given, the
    default address is used. Returns { "signature": "<hex>" }.
  • verify_message (new) — params address (WalletID), message,
    signature; returns { "is_valid": <bool> }.
  • verify_signature — unchanged; verifies against a raw public_key,
    returns { "result": <bool> }.

Protocol

CLI and API produce identical signatures, so a signature made by one verifies with the other.

  • Digest: hv = H("beam.signed.message" | pubkey | len | message)H is Beam's SHA-256 Hash::Processor, pubkey is the signer's 32-byte x-only WalletID key, and len is a width-independent varint. The fixed-width tag and key plus the explicit length make the encoding unambiguous.
  • Key: the address's SBBS keypair (get_SbbsPeerID) — the key behind the WalletID — so a valid signature proves control of that address.
  • Signature: Beam Schnorr (ECC::Signature) over hv, with a hedged nonce (secret key + message + fresh randomness).
  • Verify: address.m_Pk.CheckSignature(hv, sig) — pure crypto; needs neither the wallet DB nor a node.

Binding the public key into the digest ties each signature to exactly one address — as in Bitcoin's address-recovery check and Monero's key-prefixed challenge — which prevents related-key signature malleability. Messages carry no replay/context binding, so anything using these signatures for authentication should embed a fresh challenge or context string in the message.

The legacy key_material form of sign_message and its counterpart verify_signature keep the original key-independent digest for backward compatibility.

Explorer fix

Corrected the AMM/DEX pool table header Rate 2:2Rate 2:1 in the rich
parser and rebuilt Parser.wasm.

image

Docs

Wallet API v7.4 reference: https://github.com/BeamMW/beam/wiki/Beam-wallet-protocol-API-v7.4

@Maxnflaxl Maxnflaxl linked an issue Apr 12, 2026 that may be closed by this pull request
@Maxnflaxl Maxnflaxl changed the base branch from master to boost-1.90 April 12, 2026 12:08
@Maxnflaxl Maxnflaxl changed the title Issue/1969 Issue/1969: signing/verifying a message Apr 12, 2026
@Maxnflaxl Maxnflaxl requested a review from valdok April 12, 2026 12:10
@Maxnflaxl Maxnflaxl changed the title Issue/1969: signing/verifying a message Issue/1969: signing/verifying a message and explorer parser typo Apr 15, 2026
@Maxnflaxl Maxnflaxl marked this pull request as ready for review May 3, 2026 15:45
Maxnflaxl added 3 commits May 16, 2026 02:36
core/version.h is generated into the build dir by CMake (core/version.h.in);
the committed copy is an in-source build artifact (it hardcodes a stale
version) and no translation unit references it. make_all.sh / make_shader.sh
are shader build helpers that don't belong in this PR.
The address-based sign_message / verify_message digest is now
H("beam.signed.message" | pubkey | len | message) instead of
H("beam.signed.message" | len | message). Folding the WalletID public key
into the hash makes the Schnorr challenge key-dependent (as in BIP-340 and
Monero), binding each signature to exactly one address and preventing
related-key signature malleability; the fixed-width framing also removes the
ambiguous decimal length.

The legacy key_material path and verify_signature keep the previous
key-independent digest for backward compatibility.
@Maxnflaxl Maxnflaxl changed the title Issue/1969: signing/verifying a message and explorer parser typo #1969: signing/verifying a message and explorer parser typo Jun 20, 2026
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

Successfully merging this pull request may close these issues.

FR: signing/verifying a message

1 participant