✍️ Sign & Verify
Sign arbitrary data and verify signatures the way Keplr's signArbitrary does it (ADR-36).
How it works
ADR-36 wraps the data in an amino sign document that can never be a valid transaction: empty chain ID, zero account number and sequence, no fee, and a single sign/MsgSignData message with the signer address and the base64 data. The document is serialized as JSON with sorted keys, hashed with SHA-256 and signed with secp256k1 (low-S, 64 bytes r‖s). Verification rebuilds the same document, checks the signature, and checks that the public key really belongs to the signer address.
This covers standard secp256k1 accounts. Chains with Ethereum-style keys (Injective, Evmos) sign arbitrary data differently.