Native Programs
Renec contains a small handful of native programs, which are required to run validator nodes. Unlike third-party programs, the native programs are part of the validator implementation and can be upgraded as part of cluster upgrades. Upgrades may occur to add features, fix bugs, or improve performance. Interface changes to individual instructions should rarely, if ever, occur. Instead, when change is needed, new instructions are added and previous ones are marked deprecated. Apps can upgrade on their own timeline without concern of breakages across upgrades.
For each native program the program id and description each supported instruction is provided. A transaction can mix and match instructions from different programs, as well include instructions from on-chain programs.
#
System ProgramCreate new accounts, allocate account data, assign accounts to owning programs, transfer lamports from System Program owned accounts and pay transaction fees.
- Program id:
11111111111111111111111111111111
- Instructions: SystemInstruction
#
Config ProgramAdd configuration data to the chain and the list of public keys that are permitted to modify it
- Program id:
Config1111111111111111111111111111111111111
- Instructions: config_instruction
Unlike the other programs, the Config program does not define any individual instructions. It has just one implicit instruction, a "store" instruction. Its instruction data is a set of keys that gate access to the account, and the data to store in it.
#
Stake ProgramCreate and manage accounts representing stake and rewards for delegations to validators.
- Program id:
Stake11111111111111111111111111111111111111
- Instructions: StakeInstruction
#
Vote ProgramCreate and manage accounts that track validator voting state and rewards.
- Program id:
Vote111111111111111111111111111111111111111
- Instructions: VoteInstruction
#
BPF LoaderDeploys, upgrades, and executes programs on the chain.
- Program id:
BPFLoaderUpgradeab1e11111111111111111111111
- Instructions: LoaderInstruction
The BPF Upgradeable Loader marks itself as "owner" of the executable and program-data accounts it creates to store your program. When a user invokes an instruction via a program id, the Renec runtime will load both your the program and its owner, the BPF Upgradeable Loader. The runtime then passes your program to the BPF Upgradeable Loader to process the instruction.
More information about deployment
#
Ed25519 ProgramVerify ed25519 signature program. This program takes an ed25519 signature, public key, and message. Multiple signatures can be verified. If any of the signatures fail to verify, an error is returned.
- Program id:
Ed25519SigVerify111111111111111111111111111
- Instructions: new_ed25519_instruction
The ed25519 program processes an instruction. The first u8
is a count of the number of
signatures to check, which is followed by a single byte padding. After that, the
following struct is serialized, one for each signature to check.
Pseudo code of the operation:
#
Secp256k1 ProgramVerify secp256k1 public key recovery operations (ecrecover).
- Program id:
KeccakSecp256k11111111111111111111111111111
- Instructions: new_secp256k1_instruction
The secp256k1 program processes an instruction which takes in as the first byte a count of the following struct serialized in the instruction data:
Pseudo code of the operation:
This allows the user to specify any instruction data in the transaction for signature and message data. By specifying a special instructions sysvar, one can also receive data from the transaction itself.
Cost of the transaction will count the number of signatures to verify multiplied by the signature cost verify multiplier.
#
Optimization notesThe operation will have to take place after (at least partial) deserialization, but all inputs come from the transaction data itself, this allows it to be relatively easy to execute in parallel to transaction processing and PoH verification.