-
Notifications
You must be signed in to change notification settings - Fork 13
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: signature command in iovnscli #263
Conversation
Two notes @davepuchyr , check the signature model if it's fine, I put the text message as bytes so it will be encode in base64 in json, this is to make sure the message stays intact and cycles of marshalling and unmarshalling do not mess with ordering and hence make the sig invalid. |
@@ -2,10 +2,6 @@ | |||
|
|||
set -o nounset | |||
|
|||
echo -n "This script will remove all existing iovns configurations, wallets etc. Do you want to proceed? [Y/n] " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's nice to destroy existing wallets, etc without warning. If this is blocking some CI or script then just pipe yes into it, eg yes | ./init.sh
.
@@ -16,5 +16,5 @@ RUN mv /build/iovnscli iovnscli | |||
RUN mv /build/iovnsd iovnsd | |||
COPY ./scripts . | |||
RUN chmod +x init.sh | |||
RUN bash ./init.sh | |||
RUN sh ./init.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be RUN sh -c 'yes | ./init.sh'
to address my comment on the deletion from init.sh.
) | ||
|
||
type SignatureSchema struct { | ||
ChanID string `json:"@chain_id"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop the chain_id
as we discussed. It will only add confusion since it's irrelevant for the signing of a message.
ChanID string `json:"@chain_id"` | ||
Type string `json:"@type"` | ||
Message []byte `json:"text"` | ||
Sig string `json:"sig"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the tag to signature
.
messageJSON, err := json.Marshal(&SignatureSchema{ | ||
ChanID: cliCtx.ChainID, | ||
Type: "message", | ||
Sig: string(sig), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Sig should be base64 encoded so that it looks familiar to users.
Type: "message", | ||
Sig: string(sig), | ||
Message: buf.Bytes(), | ||
PubKey: cliCtx.GetFromAddress(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be pubkey
, not address
, no? We need the curve type, too.
Antoine invigorated Alessio to revisit cosmos/cosmos-sdk#4581, so let's see how that develops before we proceed. |
Closing this for now, eventually we can rivis it in the future |
The future arrived quickly. :) |
Obviated by #356. |
No description provided.