-
Notifications
You must be signed in to change notification settings - Fork 29
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
Auth Slates proposal #90
base: master
Are you sure you want to change the base?
Conversation
Initial draft of the auth-slates proposal
included a reference to the PR
I like the concept of using the wallets keys for something more such as a digital identity. I am not yet 100% convinced though about whether we need to use slatepacks here to interact with an exchange, but I can think of some advantages. For example, I am not sure if you planned to make the slatepacks encrypted for a specific service, but if you do encrypt them to the public-key/slate-pack address of the server/service. It would have the advantage of being armored, no user information or service information is leaked if intercepted. Maybe we should think here also about unifying signing for memo's, to signing with you digital ID's to messages, contracts etc. |
I am having some second thoughts about it. I am not sure if this won't make it possible to find wallet seed using preimage attacks. Commonly solution would be to add some cryptographic pepper as
where pepper has to be sufficiently random. But then to regain access to your account after database loss you also need to find same pepper so it complicates the recovery. Maybe an alternative would be double hashing
but I am no cryptographer, not sure if that makes it sufficiently resistant to preimage attack. Perhaps someone more experience could comment / propose something.
Very good suggestion. I think it is possible to achieve it while still having just one slatepack for login. The current login slatepack looks as follows {
"version_info": {
"version": 1
},
"authentication": "login",
"data": {
"username": "picked-username",
"url": "url-of-the-service",
"timestamp": 1657270059,
"signature": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
} we could do it as follows {
"version_info": {
"version": 1
},
"authentication": "login",
"data": {
"login-data": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"timestamp": 1657270059,
"signature": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
} In short, we replace two entries I will implement changes shortly. |
@Anynomouss I made some changes. I developed a way to have login slatepack shielded, but I did not do it for the registration slatepack. Reason for that is during the registration there is no shared secret in common, establishing one would require Diffie-Hellman key exchange which imposes an additional step in the protocol. I am not yet sure if it is worth it. I think we should discuss if it is worth it to shield authentication slatepacks as the exposed data is public anyway. Unlike the transaction building, which can be performed via third party, authentication could be assumed to be always performed directly between the two parties. Any thoughts? |
I
This should not be an issue if you use hardened derivation to derive the key for a specific service.
I am also not sure if it is needed. If the service has a public key/slate pack-address, you can encrypt using the public key of the the service provider so only they can read. Since you provide in that initial slatepack message your own specific used hardened public key, the service provider can use this to encrypt his response to the user so only he can decrypt it. In the end it is the same as how encrypting a slatepack to a slate-pack-address/public key works, with only difference that you derived one with this specific. I am not exactly sure how to integrate that with hardened derivation, but I am sure it is possible. Probably by hashing the parent parent key opposed to using the parent key directly. I think that is what HMAC is fore. See here more information on hardened versus non hardened derivation. |
Now I think about it, hashing should just solve all problems. Just HMAC-SHA512(seed2|username| url), note that HMAC_SHA512 is by default used in most crypto wallets for hardened key derivation and uses double hashing, so you can never derive a parent key. So you do not need to call HMAC_SHA512 twice, since it already double hashes by default. The upside of using HMAC-SHA512 is that the security and privacy it offers since you can never derive the same parent. |
@Anynomouss. currently I'm working on the extended key derivation for https://github.com/grinventions/mimblewimble-py and I think this can help improve this RFC a lot. Perhaps there is a way to derive the auth key using currently used and secure derivation path mechanisms. Thank you for your feedback and pls be patient I will respond as soon as I implement and understand the currently used mechanism. |
Hey @Anynomouss, I am sorry for taking so long to respond. In the meantime I did implement the Mimblewimble slatepack address derivation and now I understand it pretty well so I can return to this RFC. I like your suggestion to use HMAC-SHA512. How about a following protocol
During both registration and verification the service will extract |
Looks good to me. Also learned something new, I did not yet know ou could recover the I only looked briefly at the code, is the |
Initial draft of the auth-slates proposal