Payout Mechanism
As described earlier, a syndicate of MSPs can:
-
Generate a syndicate public key using a distributed key generation protocol.
-
Generate a threshold signature for the syndicate.
-
Replicate block templates and miner shares across the network with verifiable ownership.
With the above facilities Radpool provides a DLC based payout mechanism, where the MSP pays the miner for producing a certain hash rate. The Radpool syndicate acts as the DLC oracle for each miner’s hashrate. We now describe the payment mechanism in detail. The page on Bitcoin Contracts shows the bitcoin transactions used. First we describe the requirements for the payout mechanism and then describe the protocols that fulfil the requirements.
Requirements
The Radpool payout mechanism has to meet a few requirements. We list these first and once we have described the mechanism, show how it meets these requirements.
- Scalable use of Block Space
-
The payout mechanism should scale to tens of thousands of miners.
- Unilateral Exit
-
The miner doesn’t need permission from the syndicate to spend their reward.
- No Centralised Coordinator
-
The payout mechanism must not depend on a central entity to co-ordinate payouts to miners.
- Futures Contract
-
The Miner and the MSP enter into a futures contract exchanging hashrate for BTC. The contract is settled by Radpool’s syndicate acting as an oracle, without knowing the details of the contract.
Scalable Use of Block Space
This is an important requirement and is motivated by the scaling issues faced by P2Pool (1, 2) where the miner payouts competed with other transactions for block space.
Chris Belcher proposed a solution that required hubs to co-ordinate the payouts. We extended this idea as an alternative proposal for Braidpool. The proposal uses unidirectional payment channels and removes the dependency on predicting miner payouts by using a P2P DAG of shares. In Radpool, we propose replacing the hubs with a syndicate whose members act as Mining Service Providers. These MSPs provide liquidity, manage payouts as we explain later and maintain a consistent replicated set of shares received from all miners.
Unilateral Exit
A miner should be able to leave the mining pool with all the reward that they have earned, without requiring permission from any MSP. There are solutions, for example Braidpool’s UHPO model where miners need to send a request to the pool to obtain their payout. With unilateral exits, a miner can leave any time and if the syndicate becomes unreachable, the miner’s payout is firmly within their control.
No Centralised Coordinator
A centralised co-ordinator that makes payouts is an antithesis to a decentralised mining pool. Often there are arguments that a mining pool can make payouts over lightning network, however, all the designs in operation today require a centralised lightning node operator to make the payouts. Which means, that if the lightning node misbehaves for any reason, the miners are directly impacted. In Radpool, we make payouts in a way that does not depend on a single entity. As long as a threshold of parties are behaving correctly, miner payouts are updated and the miner can later unilaterally exit at any time.
Futures Contract
With increasing adoption of FPPS instead of PPLNS, Radpool should support an equivalent reward payout scheme where a miner and a capital provider can agree on the exchange rate and expiry. Once the contract is agreed upon, Radpool’s syndicate should act as an oracle to settle the contract and neither the miner nor the MSP should be able to block the contract execution.
Radpool Payout Mechanism
The Radpool payout mechanism uses DLCs for enabling an PPS like payout mechanism. Miners enter into a contract with MSPs with agreed upon exchange rate and an expiry, with Radpool acting as the oracle for the payout contracts. We describe the contract transactions that make up the Radpool payout mechanism and describe the interactive protocol used by the Radpool MSPs and miners.
Miner Registration
When a miner joins the pool, the request is sent to an MSP the miner is connected to. The MSP then triggers a miner registration protocol, for the Syndicate to act as an Oracle for payout contracts between the miner and the Syndicate. As part of the registration process, the miner submits a public key to the MSP. This key is used to generate the DLC payout contracts between the MSP and the miner. The miner also creates a username and password for authenticating future stratum messages. This username is also used enable verifiable ownership of shares as described in Verifiable Share Ownership section.
Radpool as the Oracle
In response to request from miner to join the pool, the Radpool Syndicate runs a single instance of DKG to generate the public key to be used for signing the DLC contract execution transactions. See DLC specs for details on these transactions. The public key generated by this DKG instance is the value for the miner .
The public nonce for the miner, , is generated by the MSP and broadcast to the syndicate. To prevent a DDoS attack where an MSP repeatedly runs DKG instances, the MSP maintains a queue of miner join requests, and runs a limited number of DKGs every fixed time period. The list of membership requests is replicated consistently by using the BFT reliable broadcast and miner join requests are handled by running a round robin request selection over MSPs. We avoid the requirement of a totally ordered broadcast which will add to communication and protocol complexity.
Note that the same public key is used for all future DLC settlements for miner , as long as the syndicate membership doesn’t change[1]. The paper also specifies that the nonce should not be re-used and can be generated by a single party. We are able to avoid running a DKG round to generate the nonce for each miner by having the miner’s MSP generate one for the miner. The MSP broadcasts the nonce value to all the other MSPs using echo-broadcast to be sure all MSPs have received the nonce.
The two values and are now available to all MSPs. The miner is then sent these values by their MSP. The miner will validate that these values have been received by other MSPs. This is possible because all MSPs allow connections and serve the public mining information. Note this functionality of the miner’s client to the Radpool syndicate doesn’t have to be on site for the miner or always online. The functionality is a wallet like application that the miner runs for registering with the MSP and managing payouts received from the MSP.
With the public values now available, the syndicate can sign the hashrate for a miner to settle that miner’s DLC contract payout. Before we describe how this works we describe the terms of contracts.
Contract Terms
Once the public values and are published, the miner and its MSP agree on the terms for the payout contract.
- Expiry
-
The block height at which the contract settles.
- Hashrate
-
The average hashrate that the miner will generate shares at between now and the Expiry.
- Amount
-
The amount of bitcoin the MSP will pay the miner for the Hashrate.
As required by DLC, the Expiry will be fixed, but there will be a number of combinations of (Hashrate, Amount) that the MSP and the miner will agree to. Here’s an example list, showing a contract where hashrate more than 1PH/s will pay the miner a million sats, and lower than 0.8 PH/s will pay nothing, and the intermediate steps will pay intermediate values. Note this list shows the contract terms at a high level, Radpool will use the exponent/mantissa optimisation proposed in the DLC paper to generate the full list of transactions necessary to execute the contract terms.
Block height | Hashrate (PH/s) | Amount (sats) |
---|---|---|
900,000 |
> 1 |
1,000,000 |
900,000 |
1 - 0.9 |
900,000 |
900,000 |
0.9 - 0.8 |
700,000 |
900,000 |
< 0.8 |
0 |
Funding and Refund Transactions
The funding transaction between the miners and the MSP is funded by the MSP and locks the output as a 2 of 2 multisig. MSP and the miner thus agree on the txid and the output that will fund the payout contract.
Before the MSP signs the funding transaction, the miner creates a refund transaction that spends the funding transaction, returning the entire amount to the MSP. The output of the refund transaction is timelocked to extend beyond the contract expiry. The refund transaction allows the MSP to claim back the funds in the case that the miner leaves the pool without claiming the contract payout.
Contract Execution Transactions
Contract execution transactions (CETs) spend funding transaction outputs with the amount BTC. This amount funds the contract and is the maximum that the MSP can payout to the miner when the contract settles. The amount needs to have a margin of safety and we discuss that later in the Capital Requirements and Fees section.
The CETs are signed by both the MSP and the miner, however, both the signatures are Adaptor Signatures that are can be decrypted when the Radpool syndicate publishes an attestation for the miner’s hashrate. We use the adapater signature technique developed to circumvent weaknesses in the initial DLC paper and described in detail by Kuwahara et. al..
The Radpool syndicate publishes miner hashrate attestations at fixed time intervals. The syndicate is never aware of the contract exchange rates between the miners and the MSPs. The syndicate is only aware of the hashrate of the miner over a given time period. At the fixed time interval, all the MSPs calculate the that has to be paid to a miner by looking at data locally available with them. They then run an instance of the threshold signature scheme to sign the message. The syndicate has to be sure to use the correct set of values when publishing the signature. The values have to be tracked for the current contract being executed. The expiry and the miner public keys help track this as the syndicate generates oracle signatures.
Once the syndicate has published a signature attesting to a miner’s hashrate, the miner can spend the output at any point in time.
Series of DLCs For Each Expiry Period
The miner and the MSP enter a contract for each expiry period. For example, if a miner wants to be paid on a weekly basis, they enter into a DLC contract at the start of each week. So a sequence of contracts can look like the table below. Each of the contract will have the full range of CETs that pay the miner a set amount of BTC for the various values of hashrate it generates.
Week | Hashrate (PH/s) | Amount (sats) |
---|---|---|
Aug 1 |
1 |
1,000,000 |
Aug 8 |
1 |
1,000,000 |
Aug 15 |
1 |
1,000,000 |
Each week’s contract is created just before the expiry of the previous week’s contract. The MSP calculates the BTC amount to pay for the hashrate and offers a contract. The miner can provide configuration options to set the minimum payout it is willing to accept for the hashrate. How the MSP calculates the BTC to pay for hashrate is not addressed here. We expect there will be extensions that offer various means and models to compute this exchange rate. MSPs are free to provide any algorithm to agree on these exchanges rates - it is up to the miner and MSP to agree on the payout contracts. Radpool simply publishes attestations that settle any contracts that the miner and MSP have agreed on.
Roll-over Contract Transactions
The DLC contract mechanism described up to now requires that the miner broadcasts two transactions when it wants to settle a DLC contract. However, as we saw in the previous section the miner wants to keep getting paid by the MSP on a regular basis as it keeps producing hashrate. Kuwahara et. al. 2020 and Kuwahara et. al. 2022 have shown that DLCs can be aggregated off-chain as parties enter contracts repeatedly. They also note that off-chain scaling where payments are always made in the same direction is possible by using the transaction revocation technique used in Bolt #3.
In our case, the MSP always pays the miner. In other words, the MSP is the only one that can benefit from broadcasting an old state. This makes the transaction revocation technique easier to apply than in the case of the Lightning Network.
Payout For MSPs - Interactive Protocol
MSPs are paide made once the pool finds a block, while the payouts to miners are made by MSPs on contract expiry. We now describe how the payouts to miners and MSPs are handled by an interactive protocol such that neither MSPs nor miners can steal any coins. The following protocol is executed as soon as the pool finds a block and the coinbase becomes spendable after 100 blocks.
-
When the pool finds a block the MSPs compute the fraction of the coinbase each of them are due by using the validated ownership of
mining.submit
messages broadcast by each MSP. -
The above reward distribution algorithm uses PPLNS to distribute rewards between MSPs.
-
MSPs construct payout transactions paying out all MSPs and broadcast these to all MSPs.
-
Once MSPs have validated that all MSPs have broadcast and received their payout transaction, they start a TSS round to sign the coinbase transaction.
-
The signed coinbase is retained by all MSPs and is broadcast once it has been confirmed up to 100 block depth.
The above protocol makes sure that all MSPs get their fair share of payout. More importantly, by decoupling payouts to miners from payouts to MSPs we make it clear that MSPs take on the risk of making PPS payouts to miners.
Meeting the Payout Requirements
Let’s see how the above scheme meets the payout requirements we listed at the outset.
- Constant Block Space
-
The coinbase of the block spends to a single p2pkh - the syndicate public key generated using DKG.
- Unilateral Exit
-
The miner always has access to a UTXO that pays the miner till the last contract expiry. It is up to the miner and the MSP to agree on the expiry length. We expect MSPs to offer various expiry and hashrate terms to meet their own and the miner’s risk preferences.
- No Centralised Coordinator
-
The Radpool syndicate acts as the oracle to settle the miner payout contracts. The syndicate is run as a FROST Federation and therefore eliminates dependency on any centralised entity. As the pool grows and the number of MSPs grow, the size of the federation increases.
- Futures Contract
-
The DLC based payout contract is a future contract that delivers miners payouts dependent only on the hashrate they generate.
Optimising Nonce Generation for Oracle Signatures
When contracts are due to expire, the syndicate publishes the attestation for settling miner payouts. There’s a couple of things that we highlight here. First, given that the syndicate has to publish as many oracle signatures as there are number of miners, we want to remove the need to produce a nonce from the critical path when generating the signatures. Instead, we use the approach that every time a miner payout is rolled over or initially generated, the MSP broadcasts a nonce to the syndicate.
-
MSP builds a message as
<MSP id, Miner username, Sequence number, R>
. -
MSP signs the message and broadcasts it to the syndicate using a echo broadcast.
-
MSP sends the same signed message to the miner.
-
Miner validates MSPs have received
R
by checking with a single MSP that is not their MSP.
Once the R
value is published for each CET, the syndicate then runs
a TSS at contract expiry time. This make it possible to scale the
payout mechanism as we eliminate the time consuming nonce generation
phase and instead use the nonce supplied by the MSP.
Scalability
The payout mechanims broadcasts transactions are when two events take place. We look at each of these events and describe how the transactions at each event are generated and broadcast to allow Radpool to scale with the number of miners.
- Coinbase confirmed
-
At this point we require number of transactions, where each MSP is paid from the block coinbase.
- Miner collects payout
-
When a miner collects their payout. No transactions have to be broadcast to the network unless by those miners who want to cash out their collected payment.
If each MSP server miners in total, this results in a scalability factor of for miner payouts. If each miner aggregates number of payouts this results in a further payout scaling factor of . Together we get a scalability factor of compared to paying all miners from coinbase outputs.
Roll overs
The payout mechanism allows for roll-over of both the transaction types listed above. As discussed earlier, miners can roll-over the their payouts to reduce the on chain fees they need to pay. There is a possibility here to move miner payout DLCs into LN contracts. We leave this optimisation out from this initial proposal as it is a well understood technique, mentioned in the initial DLC paper.
In the same way as miners roll-over their payouts, the MSPs can also signal to the syndicate to aggregate their payout until a minimum balance is reached. This is a choice the MSP can make to lower on chain transaction fees. Again, we leave such optimisations out of the current proposal.
Capital Requirements and Fees
All MSPs lock in capital to fund miner payouts. Our initial models show that a 2X margin is enough. We will soon publish the model to determine the precise margin required by an MSP to avoid going bust. Depending on how many miners an MSP registers and the hashrate those miners have, the MSP will have to lock in even more capital. We will provide MSPs with tools to compute the safe amount of liquidity required based on the hashrate their miners have.
The fee rates that the MSPs charge will be subject to open market competition. Miners can look up various MSPs and decide on the MSP based on the contract terms and the fees charged.
Payout Reward Distribution
It is important to note that the reward distribution mechanism is different for MSPs and miners. The MSPs rewards are distributed using PPLNS whenever the pool finds a block. In contrast, the miners are paid when their DLC contracts expire.
This means the two payouts happen at different times. Note that using DLCs, an MSP can not withdraw from the contract, as the syndicate will release the signature to settle the DLC contract. Therefore the risk of a mismatch between the MSP payout and the miner payout is completely on the MSP. The miner gets a fixed payout on contract expiry. For taking on the risk, the MSP will charge the miner a fee. We will publish the model to compute this risk and provide dashboard tools for MSPs to compute the margin they need to provide.
The image shows an example situation where the pool finds blocks more often than DLC contract expiry selected by the miner and the MSP.