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

Subspace should be a hash value #82

Closed
kwunyeung opened this issue Jan 21, 2020 · 3 comments · Fixed by #84
Closed

Subspace should be a hash value #82

kwunyeung opened this issue Jan 21, 2020 · 3 comments · Fixed by #84
Assignees
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Milestone

Comments

@kwunyeung
Copy link
Contributor

kwunyeung commented Jan 21, 2020

subspace in Post is better in hash value so that it can be verified by the users by comparing the hash value instead of relying on comparing with a string.

Consider an imposter is trying to build an app and put subspace as C0SMOS to pretend to be an app discussing things on COSMOS.

But I don't have an idea of how the UX can be done to let normal endusers to verify this yet. @RiccardoM @bragaz please comment.

@RiccardoM
Copy link
Contributor

I'm personally in favor of this change. This would just require one small additional check inside the Validate method of both MsgCreatePost and Post types:

  • susbspace should be a valid SHA-256 hash in HEX form

This can be easily done using the following RegEX:

^[a-fA-F0-9]{65}$

@RiccardoM RiccardoM added kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module labels Jan 21, 2020
@RiccardoM RiccardoM added this to the v0.3.0 milestone Jan 21, 2020
@leobragaz
Copy link
Contributor

leobragaz commented Jan 21, 2020

This makes sense, also because with only strings we can have users writing "deSmOs", "desm0s" and so on..We will provide a better order using hash so I totally agree with implementing this.

@kwunyeung
Copy link
Contributor Author

kwunyeung commented Jan 22, 2020

I have one comment in the PR #84 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants