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

Authentication using Handshake name #6

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Falci
Copy link
Member

@Falci Falci commented Oct 26, 2020

This HIP describe how to authenticate a user using his/her Handshake name.

@Falci
Copy link
Member Author

Falci commented Oct 26, 2020

I'd like to request a special attention to the Exposing the public key section. It's totally arbitrary

@zfogg
Copy link

zfogg commented Oct 27, 2020

this is awesome. do none of the commonly used .well-known/ services work for this? i'm surprised there isn't an ietf rfc that implements something like this already

@Falci
Copy link
Member Author

Falci commented Oct 27, 2020

I checked the Wikipedia list and the IANA list but I didn't spot anything that could be used instead.

@Falci
Copy link
Member Author

Falci commented Oct 28, 2020

What would you prefer?

  1. web+hns://authentication/?challenge=<CHALLENGE>&callback=<CALLBACK>
  2. web+authentication://<CHALLENGE>@<CALLBACK>
  3. web+auth://<CHALLENGE>@<CALLBACK>
  4. Other?

@zfogg
Copy link

zfogg commented Oct 28, 2020

@Falci I suppose if there's nothing particularly Handshake specific about the implementation, then other projects could implement it or be compatible with it as well; no need to include "hns" in the spec unless hns is actually required for it to work and it won't work without hns, you know? so the second option looks the best to me, although the third option is most aesthetically pleasing.
i say number 2!

@brandondees
Copy link

@Falci I vote definitely not the prefix for 1, as this scheme is orthogonal to HNS. i think there is prior art that would collide with 2 and 3 so maybe some more homework is in order before committing to the protocol handler side of it. assuming there's no conflict or confusion with other schemes, web+authentication is less ambiguous. i'm not sure about the @ which already implies email addresses and could be confusing. the query string format seems like it would be conventional and flexible. again, i'd suggest digging through all the existing standards for this type of scheme first to avoid conflicting approaches or re-discovering issues that have already been figured out by other teams.

i understand that there may be nothing already on the .well-known lists, but there are definitely tons of existing auth protocols including ones with challenge-response modes, redirect callbacks, and special protocol handler schemes, many of which could probably be informative for these design choices.

@Falci Falci marked this pull request as draft January 21, 2021 15:22
@Falci
Copy link
Member Author

Falci commented Feb 8, 2021

Just to keep track: this should be merged as HIP-0003

@handshake-org handshake-org deleted a comment from Abhishek5772705 Jun 5, 2021
@handshake-org handshake-org deleted a comment from Abhishek5772705 Jun 5, 2021
@handshake-org handshake-org deleted a comment from Abhishek5772705 Jun 5, 2021
@handshake-org handshake-org deleted a comment from Abhishek5772705 Jun 5, 2021
@Falci
Copy link
Member Author

Falci commented Jun 11, 2021

Does this HIP still make sense after the handshake-org/hsd/pull/609 ?

@pinheadmz
Copy link
Member

@Falci I think so, it's different things. Users will likely want to store names on hardware wallets and name authentication may be a situation where they want to use a different set of keys, or rotate the keys more frequently, etc.

@NetOpWibby
Copy link
Contributor

NetOpWibby commented Nov 22, 2021

Is there a(n optional) way to use a hardware wallet as part of the authentication scheme?

Copy link
Contributor

@NetOpWibby NetOpWibby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some grammar updates and removing gender.


## Abstract

This HIP describe how to authenticate a user using his/her Handshake name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This HIP describes how to authenticate a user using their Handshake name.


## Motivation

Many websites need to identify the user and proof he/she owns a Handshake name. Many other websites simply need to identify users, which forces them to go into a process to pick a unique username that most of the time can't be consistent across different apps. By using Handshake names as username it allows both: proof ownership of the name and consistent username across unrelated apps.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many websites need to identify the user and prove they own a Handshake name. Other websites simply need to identify users, which forces the user to enter a process of picking a unique username that most of the time can't be consistent across different apps. Using Handshake names as usernames allows both to happen: prove ownership of a name and have a consistent username across unrelated apps.


The basics of this protocol consist of a public and private ECDSA key. The domain exposes the public key via HTTPS request.
The Service that wants to authenticate the user should provide this user with a unique challenge.
The User signs the challenge using his/her private key and returns it to the Service, among the public key and the domain name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The User signs the challenge using their private key and returns it to the Service, along with the public key and domain name.

The basics of this protocol consist of a public and private ECDSA key. The domain exposes the public key via HTTPS request.
The Service that wants to authenticate the user should provide this user with a unique challenge.
The User signs the challenge using his/her private key and returns it to the Service, among the public key and the domain name.
The Service then validates if the challenge is correct and was correct signed. The Service also validates if the domain name indeed exposes that public key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Service then confirms the challenge is correctly signed. The Service also validates if the domain name indeed exposes the public key.


### Provider

The above-mentioned flow requires an extra piece of software: a user-trusted provider. This provider knows/holds the user's private key. It can run on the client-side, as a browser extension or an installed app; or it can run remotely as a regular web service.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above-mentioned flow requires an extra piece of software: a user-trusted provider. This provider knows/holds the user's private key. It can run client-side, as a browser extension, as an installed app, or run remotely as a regular web service.

When the Service is called via its callback URL, it should do the following verifications:

- Check if the domain exposes a public key.
- Check if the challenge is the same challenge from the request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Verify the challenge is identical from the request.


When the Service is called via its callback URL, it should do the following verifications:

- Check if the domain exposes a public key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Verify the domain exposes a public key.


- Check if the domain exposes a public key.
- Check if the challenge is the same challenge from the request.
- Verify if the signature is valid (using the already retrieved public key).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Verify the signature is valid (using the already retrieved public key).


Note: there's no point in adding the public key in the response from the Provider to the Service since it won't be trusted.

Once all verifications are complete, the Service can use the `domain` to identify the current user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once all verifications are complete, the Service can use the domain to identify the current User.

This proposal does not force the domain name to be a TLD. Users could authenticate themselves with `support.example` for instance.

There's no need to be strict with a Handshake domain name. Users could authenticate themselves with `example.com` for instance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, there's no need to be strict with a Handshake domain name. Users could authenticate themselves with example.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants