You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, Kubo will return "Self" as an IPNS key, using the identity of your own node. The problem is that turning a string into a MultiHash always tries to convert to Base58, which identity hashes are not.
To repro:
new MultiHash("k51qzi5uqu5dj38iif6tbbg7embsfa3l5yk4ld8e2c9n3obgk41n7ot7nepp6l");
Output:
...threw an exception of type 'System.InvalidOperationException'. "invalid character: l"
at SimpleBase.Base58Alphabet.get_Item(Char c)
at SimpleBase.Base58.Decode(String text)
at Ipfs.Base58.Decode(String s) in .\net-ipfs-core\src\Base58.cs:line 69
at Ipfs.Base58.FromBase58(String s) in .\net-ipfs-core\src\Base58.cs:line 84
at Ipfs.MultiHash..ctor(String s) in .\net-ipfs-core\src\MultiHash.cs:line 223
This is especially problematic because the default node will throw if you try to retrieve the ipns keys.
The text was updated successfully, but these errors were encountered:
I've re-identified this issue in Ipfs.Core where the peer id (libp2p-key) for Ipns addresses don't work for Cidv1. This was added to libp2p in 2019 in (see RFC 0001), after Richard (the original developer) stepped away from the project, so it hasn't been added.
When we add support for the libp2p-key MultiCodec (0x72), we'll be able to differentiate between these implicitly using Cidv1.
As a workaround, if you'd still like to store the IKey.Id multihash representing an IPNS key as a normal Cid, you can inline it with:
varipnsPeerCid=new Cid {Hash= key.Id };
When resolving, you'd need to use the .Hash instead of the Cid itself:
By default, Kubo will return "Self" as an IPNS key, using the identity of your own node. The problem is that turning a string into a
MultiHash
always tries to convert to Base58, which identity hashes are not.To repro:
Output:
This is especially problematic because the default node will throw if you try to retrieve the ipns keys.
The text was updated successfully, but these errors were encountered: