The problem with secp256k1
The Requirements
- As an ETH Node operator, I want to use my Ethereum keys for my node identity on RChain.
- I need to generate a TLS certificate from my Ethereum keys so I can boot up my RChain node.
- The RChain network will use the node identity as the validator identity.
- Block proposal messages will use the same private key as communications.
- As a node operator I only want to manage a single set of keys per node instance.
Definitions:
Node Identity: Nodes are identified by a public key address on the RChain network. IP addresses can change, and it's important that all messages on the network be identifiable by a mechanism other than the IP address sending the message. A public key address serves this purpose.
Validator Identity: Validators also have a public identity that is represented by a key. Validators participating in the consensus protocol have to sign block proposal messages with their private key. Validators bond amounts are associated with their public identity (key).
Motiviation
Reference: https://github.com/grpc/grpc-java/blob/master/SECURITY.md
Technical issue:
The gRPC java implementation depends on netty-tcnative. netty-tcnative uses boring-ssl as a drop in replacement for open ssl. boring-ssl does not have an implementation of secp256k1 in it. The functions for k1 are in the header files for boring-ssl, but the actual implementation is not included.
Options:
- Use netty-tcnative with open ssl - dynamically linked option. Declare open ssl as a dependency and link to it. A file that uses C macros to do version management for open ssl has shortcomings in that it does not provide support for all the versions of open ssl that we would need. A senior developer would need to update the C macros and validate that the multiple supported versions of open ssl all work properly on Debian, Fedora and OSX
- Produce a netty-tcnative jar that includes the right version of open ssl statically linked to netty-tcnative. We could use this jar for all linux x86 64 platforms. Separate jars for OSX and Windows would be required, along with code to check the platform and dynamically load the right jar on startup
- Write the secp256k1 implementation for boring-ssl. Not sure if the pull request would be accepted and merged into the project.