go-libp2p icon indicating copy to clipboard operation
go-libp2p copied to clipboard

custom signature scheme: dial attempt failed: proto: can't skip unknown wire type 6 for crypto_pb.PublicKey

Open helinwang opened this issue 6 years ago • 5 comments

Hi,

I wrapped a custom priv/pub signature scheme to implement the go-libp2p-crypto.PrivKey and go-libp2p-crypto.PubKey interface. But got the following error when running the chat example:

dial attempt failed: proto: can't skip unknown wire type 6 for crypto_pb.PublicKey

Is custom signature scheme currently supported?

helinwang avatar May 22 '18 14:05 helinwang

The default chat.go works for me.

helinwang avatar May 22 '18 14:05 helinwang

This two commits add support to the BLS signature scheme:

https://github.com/helinwang/go-libp2p-crypto/commit/e0b70571efc4c1424523637c01f89488c04133e0 https://github.com/helinwang/go-libp2p/commit/5025955d87a24cd0dd2aa642521ff43e7118115b

Any possibility for it gets merged? (adds a new dependency to "github.com/dfinity/go-dfinity-crypto/bls" though.)

Btw, I have not used gx before, I have published my own version of go-libp2p-crypto (hash is here: https://github.com/helinwang/go-libp2p-crypto/commit/e0b70571efc4c1424523637c01f89488c04133e0#diff-d95150d9db6fb31091770e6d6105b08dL1 ), will it be persisted on IPFS forever?

Thank you!

helinwang avatar May 22 '18 15:05 helinwang

will it be persisted on IPFS forever?

Not unless someone pins it.

dial attempt failed: proto: can't skip unknown wire type 6 for crypto_pb.PublicKey

In your public and private key's Bytes() function, you'll need to wrap your serialized key in a github.com/libp2p/go-libp2p-crypto/pb.{PublicKey,PrivateKey} protobuf. Take a look at the Bytes() implementation for Ed25519 and RSA.

We'll probably want to take a close look at the BLS implementation but I'd love to include this if you make a PR.

Stebalien avatar Jun 21 '18 21:06 Stebalien

@helinwang Any update on including BLS signature scheme in Libp2p?

aratz-lasa avatar Jul 25 '22 15:07 aratz-lasa

Hi @aratz-lasa I don't have plan to spend time on this. Please feel free to use the code if you are working on this.

helinwang avatar Jul 26 '22 03:07 helinwang