libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.58k stars 275 forks source link

Specify encoding of secp256k1 public keys #190

Open yusefnapora opened 5 years ago

yusefnapora commented 5 years ago

The peer id / key spec currently says we use the "Standard bitcoin encoding" for secp256k1 keys, but there are a few different potentially valid encodings for public keys.

The one we actually use is the compressed form, which only stores the X coordinate and a flag for the sign and uses 33 bytes. There are apparently two different 65-byte encodings as well, looking at the btcd code.

Anyway, we should specify the encoding we're using. It's probably worth just spelling it out, rather than trying to link to an external spec.

Warchant commented 5 years ago

cc @masterjedy