Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Feed API: Lack of information about wrong signature #983

Closed
xrn opened this issue Nov 7, 2018 · 5 comments
Closed

Feed API: Lack of information about wrong signature #983

xrn opened this issue Nov 7, 2018 · 5 comments

Comments

@xrn
Copy link

xrn commented Nov 7, 2018

Here is my issue about CLI - #979

This one is about API interface
When the signature is not correct using the example from Swarm documentation - https://swarm-guide.readthedocs.io/en/latest/usage.html#javascript-example - and MetaMask signature

sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)))

Where message = digest

I probably receive the wrong signature (pls let me know is comment if I should use for it Ethereum Signed.... or no). When I send it I receive status 200 but the feed is not updated. Here is an issue with missing signature ethereum/go-ethereum#18008 and it is fixed and returns 400 (could be 401 as well). In my opinion, the wrong signature case should return 403

@jpeletier
Copy link
Contributor

@xrn Signing with Metamask prepending the "Ethereum Signed Message" header is not supported yet. It would imply changing the signing scheme in Feeds.

This is an open debate: When signing a feed update, there is really no easy way the users know what they are signing when Metamask pops up. They would just see a blob of binary-encoded data.

Additionally, for most Feeds use cases (e.g., posting messages to a forum-like app or the like), you would actually be signing quite a number of times, so you'd have Metamask popping up for every action-- really annoying.

Also consider that the private key used to sign a Feed should not be the same private key you use for money. These keys should almost be throwaway or not important, so perhaps you could relax the security a bit for these keys.

In the meantime, check out this complete JS signature example:
https://github.com/epiclabs-io/swarm-samples/tree/master/feed/digest

I hope that helps

@xrn
Copy link
Author

xrn commented Nov 8, 2018

Great thanks for the example! But still I think API should not return 200 and some additional message will be useful.

@jpeletier
Copy link
Contributor

Does the 200 status code still happen after #18008 was merged? If so, can you share the steps to get a wrong 200? Thanks

@xrn
Copy link
Author

xrn commented Nov 8, 2018

I will check when code will be released

@zelig
Copy link
Member

zelig commented Nov 26, 2018

closed by ethereum#18047

@zelig zelig closed this as completed Nov 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants