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

Add a smapp-compatible wallet sign subcommand #101

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

xearl4
Copy link
Contributor

@xearl4 xearl4 commented Mar 9, 2024

Motivation

smapp has a simple message signing functionality, which uses a wallet's keypair to sign text messages using Ed25519ctx. This functionality is used by, for example, Team24 to authenticate an sm1 address owner. The functionality is also supported by the third-party wallet implementation smeshwallet.com.

Description

This change adds a simple smcli wallet sign subcommand, which takes a wallet JSON and a message as arguments, signs the message, and outputs a smapp-compatible JSON structure of message, signature, and signer public key.

Sample Output

$ smcli wallet sign wallet.json "hey, it's now $(date -u -Is)!"
Enter wallet password: 
{
  "text": "hey, it's now 2024-03-09T22:35:01+00:00!",
  "signature": "0xec4d98c62ba07467b6eaf078d0974ccd3020ff763a638090935828a20913e4af0edd9550d98ad318f2766eb0f24c7b29038f33fa765228e93dc215437f7f7d03",
  "publicKey": "0xba24fa22891ea77c41027d16694858f4bb397b47baf6ca93a1847318e96765de"
}

@xearl4 xearl4 force-pushed the sign-command branch 2 times, most recently from cccdf31 to 2bce2ae Compare March 11, 2024 19:28
Motivation
----------

smapp has a simple message signing functionality, which uses a wallet's
keypair to sign text messages using Ed25519ctx. This functionality is
used by, for example, Team24 to authenticate an sm1 address owner. The
functionality is also supported by the third-party wallet implementation
smeshwallet.com.

Description
-----------

This change adds a simple `smcli wallet sign` subcommand, which takes a
wallet JSON and a message as arguments, signs the message, and outputs a
smapp-compatible JSON structure of message, signature, and signer public
key.
@lrettig lrettig added the Community Contribution Contribution from the open source community label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution Contribution from the open source community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants