-
Notifications
You must be signed in to change notification settings - Fork 233
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
IPNS: support Ethereum wallet signing #323
Comments
Thank you for filling this. FYSA the modern IPNS specification, including details how records are created and validated, is being documented in #319. Give it a read – that PR documents how go-ipns and js-ipns work today. See "Backward Compatibility" section to understand the constraints and our policy around not breaking legacy clients (tldr: IoT device must be able to fetch and validate IPNS record with firmware update). Something you may find useful, are Extensible IPNS Records. Our libraries do not expose easy way of adding fields to |
THanks for the link to #319 the existing spec didn't say much about data (nor did it talk about the v2 sig thats in the code). So excited to give this a look! |
Left a comment on #319 could totally see how we could add extra CBOR fields. SignaturePrework : Ethereum But those would be replacements not additions to signature v2 for those records becasue we wallets won't give out access to the private keys in any reasonable UI flow. Would it be fine for only some nodes accept and circulate these records? Is it different from adding a new Public Key type in the future? Thanks again. |
I mean, the network does not care – it will simply ignore these additional fields. It is more a question of your use case: If you are creating software that will both create and validate this additional metadata, then you can do whatever you want: as long you also include a valid IPNS signature that is in the spec, DHT nodes and PubSub routers will accept IPNS PUT your software does. |
@paulgmiller, some additional notes around "signing IPNS record with Metamask" use case. On signing IPNS records with MetamaskDiscussed this with @2color today in the context of ipfs/js-ipns#192 (making it possible to sign valid IPNS records with Multiple types of secp256k1 signaturesiiuc Ethereum and IPNS use different hash functions and prefix signed payload with different bytes:
IPNS should not depend on any blockchain specificsGiven the above, we have incompatible signatures. This raises even more questions:
Finally, Ethereum ecosystem seems to have competing signature standards: there are 4 standards, and they already discuss adding v5. This does not bring a lot of confidence into stability and interoperability. 👉 I think all these questions and rabbit holes should be avoided. IPNS signatures must be chain-agnostic. IPNS is routing-agnostic (records can be resolved via DHT, PubSub, and soon Gateways). We allow multiple key types, but the way signatures are created must remain IPFS-specific to
What are the next steps?For "signing IPNS with Metamask" use case, I see three paths forward:
|
This is a great write up and way more than I expected from this issue. Thank you very much. I totally get the concerns about ipns not chaining itself to any of the many blockchain standards maybe if that stabilizes it coming years there might be a defacto standard but probably too early to tell. Speaking towards the next steps. I think the main issue with "dual signing" is that ipfs nodes will only keep the latest revision so an ipfs node has to generate a new key for each "eth/metamask" user that wants to use it otherwise it will only be able to serve one forieng user. So if that user moves between nodes it'll be lost what public key to look up. So you need another global source of truth like ens/dns to be updated when that happens. For "using current ipns spec" you need not just metamask but all wallets to pick this up doable but very long term in my mind. My current plan is to just create an application specific version of ipns that publishes via pubsub so apps that want this can get it. The BIG downside of this is only apps that know about it participate. You can't get all the ipfs nodes to participate. But it does let us get ipns pointers passed around and we can come back to "modify ipns spec" if there is every any successful app here. Thanks again! |
Wow, there's a lot to take in here! I would recommend, before picking a path and getting to work, doing a tiny bit of research on the metamask Snaps project and its custom signing and deterministic key derivation capabilties! Snaps are basically MM plug-ins, and AFAIK the preferred way for external teams to extend metamask signing and key handling capabilities... |
To elaborate on (or summarise) what @lidel mentioned, all current signing methods in the Ethereum ecosystem ((https://eips.ethereum.org/EIPS/eip-191 and https://eips.ethereum.org/EIPS/eip-712)) are unsuitable for interoperability with IPNS for two reasons:
This leads to the three options laid out:
I'll be getting in touch with the Metamask folks via CASA to make them aware and investigate some possible future paths. |
Hello from an engineer working on MetaMask Snaps. There have been quite a few requests to us for different cryptographic primitives and signature schemes, including JWT tokens, Bitcoin signatures, IPLD through CACAO, plain RSA, etc. We can't support all of them due to their sheer count. What we're trying to achieve is to allow the community to agree on common standards themselves and then allow people to extend MetaMask using Snaps to support that specific use-case. We're allowing Snaps access to raw private key entropy so a Snap that provides IPNS signatures is possible. In short, I'm suggesting it might be easier to write a plugin for MetaMask to support IPNS rather than updating the IPNS spec to support MetaMask, and our team will do everything what we can support you on that route. |
Thanks for the update @ritave I suppose the Filsnap might be worth looking at for how to do so signing with Metamask Snaps, e.g. https://github.com/ChainSafe/filsnap/blob/master/packages/snap/src/rpc/signMessage.ts#L102 |
I think it would be pretty useful if ipns recognized the signing prefix used by ethereum wallets. That way users with metamask or other wallets could sign ipns records to send to trusted nodes or providers like cloudflare, web3-storage, pinata without having to manage their own set of keys.
I think this would open up some interesting possibilities of distributed blogs other frequently updated content.
I think this would be pretty possilble to do in both go|js-ipns. Been poking around with a branch that can validate thos sigs
But if desired not sure if it would be best to
Happy to try and contribute if wanted and someone is willing to guide preferences.
Some background here
The text was updated successfully, but these errors were encountered: