Create Validator on Ethereum
Creating a Validator on Ethereum requires 32 ETH for activating it for Consensus Layer Validation duty, there are currently few ways you could become a validator either with your own ETH or from a staking pool. Once you have a validator on consensus layer, you are able join K2 staking via native delegation by proving your ownership of your validator signing with its signing Key on PoN proposer registry. This process will replicate the underlying validator consensus layer active state and register it with an ECDSA address on execution layer along with a designated fee recipient supplied by the registering user for receiving ETH.Registering as a Validator on PON (Proof of Neutrality) Network
Before performing native delegation on the K2 Lending contract, ensure that your validator is registered and activated on the PON network. This can be done through the PON SDK.PON SDK
Follow the PON SDK tutorial to register your validator with the PON network.Obtaining BLS and ECDSA Signatures
To perform native delegation on the K2 Lending contract, you need to prove ownership of both BLS and ECDSA signing keys. Here’s how to obtain these signatures:Install the required packages by running:
Prepare the following parameters:
- Private key with a small amount of Goerli ETH (it must match the ECDSA public key of the representative address that is allowed to manage the PoN proposer registry login).
- Ethereum provider URL.
- Keystore file of your registered and active validator.
- Password for the keystore file.
Unlock the Keystore File:
Use the PON SDK to unlock the keystore file and obtain the BLS public key and private key.Prepare Registration:
Run the prepareRegistration function to obtain the required BLS and ECDSA signatures (proof of ownership to prevent spoofing).Performing Native Delegation on K2 Lending
To complete the native delegation on the K2 Lending contract, follow these steps: Install the K2 SDK : Install the K2 SDK by runningnpm i @blockswaplab/k2-sdk
.
Create Ethereum Signer: Create an Ethereum signer using your private key and Ethereum provider.
const provider = new ethers.providers.JsonRpcProvider(providerUrl);
const signer = new ethers.Wallet(PRIV_KEY, provider);
Run nodeOperatorDeposit Function: Use the K2 SDK to call the nodeOperatorDeposit function with the required parameters.
signer.address
must match the representative address in the PoN proposer registry login.