-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delegated staking #35
Comments
proposal for design: In order to delegate a blockstake output to a third party, a new output type (type 5) is defined. The condition in this output holds 2 single signature ( {
"value": 1, // amount of blockstake to lease
"condition": {
"owner":"0100112233445566778899aabbccddeeff00112233445566778899aabbccddeeff",
"delegate":"010123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}
} The output can be spend with a singlesig fulfillment of one of the 2 included addresses. Similar to the multisig wallets, a wallet can then check the addresses within the known delegated outputs. If it finds a singlesig address which it own in the "owner" field, then it can add the value to a new "leased out" field, so the wallet knows it owns the blockstake but can't do anything with them untill they are recovered. Likewise if a wallet finds an address it owns in the delegate field, it can add the output to a new "leased to me" field. The blockcreator will need to take into account the blockstakes which have been leased to its wallet. The biggest problem is that there currently is no way for an input to also impose restrictions on the way it is then spend. So we will also need to modify the consensus set code which validates a transaction. More precisely, if the output is spend by the delegate, it is only valid if it recreates the exact same output, and is the only input/output pair in the transaction (thus this is a block creating transaction which only respends the blockstake for the proof of blockstake protocol). If the output is unlocked by the owner, it MUST be in a valid transaction which changes the output, thus not being a pure block creating tx, meaning there must be a transaction fee. The owner IS allowed to reclaim the blockstake by creating a singlesig output to itself, but this requires a txfee. |
Indeed, I wonder if it might be better to modify the current block creation by no longer spending the blockstake. If it's only a lease, then the owner might also be dropped, leaving the current sending and owning of blockstakes untouched. |
On the last remark, I think I understand now since you do not reference the blockstake output, hence the owner and the amount but how do we redelegate then? |
I imagine similar to how we do it know? |
As it turns out the transaction seems to be injected in the |
After some discussion with @robvanmieghem this morning, a different approach could be: Create a new block creation transaction version. This transaction has no inputs or outputs, and is always tx 0 in the block. Instead of a blockstake input which gets respent, it only holds a reference to a delegate condition. The delegate condition itself would then be rewritten to be: condition: {
blockstake_output_id: xxxxxxxxxxxxxx...,
delegate: {} //actual delegate condition, single sig, timelocked, ...
} This means that the blockstake is no longer spent in order to delegate to someone, instead a reference is created along with a condition which needs to be fulfilled in order to be able to create blocks. The owner can then reclaim / redelegate / ... the blockstake simply by spending the referenced output. This also means we need to block the regular owner from creating a block creation tx with this output, as else there would be 2 block creators trying to use the same block stake output to create blocks (since the delegation will use its own ID in the block creation tx). |
Closed in favor of #147 |
Currently the blockstakes are handed over to the addresses of the blockcreators, this means that the private keys have to be fetched and stored from the containers running them to recuperate the mining fees and recover the blockstakes in case of node crashes.
It would be better to authorize a node to create blocks.
In a first version, let's keep it simple and give the mining fees to the address holding the blockstake authorizing the blockcreation.
The text was updated successfully, but these errors were encountered: