ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

Use Ethereum Provider from wallet for private keys to be used as peer ID in IPNS #4229

Closed Lupiano closed 1 year ago

Lupiano commented 2 years ago

Hello, I don't know if it's already possible but is there a way to use an Ethereum (or any other blockchain) provider so that the private keys from a wallet that is signed in to Metamask (or any other) can be used in some way as peer IDs when publishing an IPNS? This way any published IPNS would be "owned" by the ethereum wallet and could only be changed by that.

welcome[bot] commented 2 years ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

lidel commented 1 year ago

Not possible atm, we are tracking this topic in https://github.com/ipfs/specs/issues/323. tldr: see my explainer at https://github.com/ipfs/specs/issues/323#issuecomment-1349619822

Lupiano commented 1 year ago

I actually found a workaround. Generating a new key that will be used in the "ipfs name publish" command and assigning a random password. The random password is encrypted using the private key from the wallet connected to Metamask (making use of DID) and then stored in a Smart Contract where I map the address -> encryptedPassword. This way, only the account will be able to decrypt the password to unlock the private key and sign the IPNS update.

Probably this is not the best approach but it was the only workaround that I found. Do you see any security concern?