POW Distribution
PoW or Proof-of-Work is a mechanism which allows SKALE chain owner to mine sufficient amount of sFUEL to any address to send transaction, if address doesn’t have enough amount of sFUEL.
PoW Usage
- The client generates a unique gasPrice value based on the transaction data
- The client sends transaction with a unique gasPrice value and the required gasAmount, which was calculated during the algorithm.
- GasPrice and gasAmount of this transaction will be checked on the SKALE chain side by the same check in the algorithm.
- Transaction is executed, even without sFUEL in the client’s account.
PoW algorithm
- The client generates a random 256-bit X by Formula which is equal a unique gasPrice value
- Check whether X is allow to run transaction
a. If not, then back to the first step
b. If the condition is met - send the transaction with gasPrice = X and gasAmount = freeGas(X)
PoW sFUEL Distribution
- Get a wallet to sign transactions - a random generated one can be used since PoW based transactions don’t require signer to have sFUEL
- Create a transaction to call sFUEL distribution contract function
- Unique gasPrice function generated - based on: signer address, signer nonce and gas
- Send transaction with the unique GasPrice
Available On-Chain sFUEL Faucets
Chain | Mainnet Address | Testnet Address | Function Signature |
---|---|---|---|
Europa | 0x2B267A3e49b351DEdac892400a530ABb2f899d23 | 0x366727B410fE55774C8b0B5b5A6E2d74199a088A | 0x0c11dedd |
Calypso | 0x02891b34B7911A9C68e82C193cd7A6fBf0c3b30A | 0x62Fe932FF26e0087Ae383f6080bd2Ed481bA5A8A | 0x0c11dedd |
Nebula | 0x5a6869ef5b81DCb58EBF51b8F893c31f5AFE3Fa8 | 0x000E9c53C4e2e21F5063f2e232d0AA907318dccb | 0x0c11dedd |
Titan | 0xa5C297dF8f8386E4b940D61EF9A8f2bB367a6fAB | 0x08f98Af60eb83C18184231591A8F89577E46A4B9 | 0x0c11dedd |
Implementation Example
-
Random signer generation
-
Request creation to call sFUEL distribution contract function
-
Unique Gas Price Generation
-
Call sFUEL distribution contract with unique Gas Price
-
Random signer generation
-
Request creation to call sFUEL distribution contract function
-
Unique Gas Price Generation
-
Call sFUEL distribution contract with unique Gas Price
-
Random signer generation
-
Request creation to call sFUEL distribution contract function
-
Unique Gas Price Generation
-
Call sFUEL distribution contract with unique Gas Price
-
Random signer generation
-
Request creation to call sFUEL distribution contract function
-
Unique Gas Price Generation
-
Call sFUEL distribution contract with unique Gas Price
-
Random signer generation
-
Request creation to call sFUEL distribution contract function
-
Unique Gas Price Generation
-
Call sFUEL distribution contract with unique Gas Price
The code below can be found on the skale.dart repo.
-
Random signer generation
-
Request creation to call sFUEL distribution contract function
-
Unique Gas Price Generation
-
Call sFUEL distribution contract with unique Gas Price