Khala Mining Guide
Khala Network is Phala’s canary network on Kusama Parachain featuring decentralized mining. We provide an overview to setup the mining environment, followed by a detailed explanation of each step.
Miners, also referred to as “Workers” in Phala blockchain, provide computing power to the Phala Network. Anyone with the appropriate hardware can participate.
More information about hardware requirements: 👉 here
This section provides some theory about the mining concepts of Phala and additional background information.
To get directly started, feel free to check the quick start guide: 👉 here
Registration is required before a worker or gatekeeper can join the network. After that, any parties with secure-enclave-supported devices can serve as workers. To register as a validated worker in the blockchain, Secure Enclave runners need to run
pRuntime and let it send a signed attestation report to gatekeepers.
pRuntime requests a Remote Attestation with a hash of the
WorkerInfo committed in the attestation report.
WorkerInfo includes the public key of
EcdhKey and other data collected from the enclave. By verifying the report, gatekeepers can know the hardware information of workers and ensure that they are running unmodified
The attestation report is relayed to the blockchain by
register_worker() call. The blockchain has the trusted certificates to validate the attestation report. It validates:
- The signature of the report is correct;
- The embedded hash in the report matches the hash of the submitted
register_worker() is called by workers, and a worker can only be assigned contracts when it has certain amounts of staking PHA tokens. On the blockchain there is a
WorkerState map from the worker to the
WorkerInfo entry. Gatekeepers will update the
WorkerState map after they receive and verify the submitted
Offline Worker Detection
pRuntime of a worker is regularly required to answer the online challenge as a heartbeat event on chain. The blockchain detects the liveness of workers by monitoring the interval of their heartbeat events. A worker is punished with the penalty of his staking tokens if it goes offline during a contract execution.
If you have any questions, you can always reach out to the Phala community for help:
Khala requires the following components:
- Khala RPC Endpoint:
- Khala Console: Mining Console