hypercore-protocol / hypercore-next

Hypercore 10 is an append only log with multi-writer primitives built in.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error `Hypercore key should be 32 bytes` reduces the usefulness of custom `opts.crypto`

Nuhvi opened this issue · comments

commented

Checking for a 32 bytes publicKey makes is it impossible to use secp256k1 compressed publicKey
https://github.com/hypercore-protocol/hypercore-next/blob/master/index.js#L35

Possible solution:

    if (!opts.crypto && key && key.byteLength !== 32) {
      throw new Error('Hypercore key should be 32 bytes')
    }

Yea good solution, wanna PR?

commented

On it.