Skip to content
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

PoS mining delegated staking without supernodes deign to help users voting. #402

Open
betachen opened this issue Aug 12, 2020 · 2 comments

Comments

@betachen
Copy link
Member

No description provided.

@canguruhh
Copy link
Member

canguruhh commented Sep 4, 2020

There are 2 signatures involved in PoS block creation. One is the spending of the vote utxo in the coinstake transaction and the other one is the block signature that signs the whole block.

  1. Quick way: For the spending of the utxos the staking user can already create a chain of valid coinstake transactions for every vote and send all to the delegate. The delegate can then just use those already signed transactions when the vote has its turn.
    Clean way: Add a new opcode that allows a script that lets the delegate spend the vote utxo only if the outputs of the transactions have the same script as the previous output of the vote utxo. The staking user could of course still spend it without restrictions. This way all vote utxos with the new script can be used by the delegate only to send it back to use staking user.

  2. Currently the consensus rule for the block signature takes the pubic key for the signature check from the first input of the coinstake transaction. It just reads the last item which is the top item on the stack. We could completely change this rule so that it would take the public key from some additional output of that transaction or we create a new script that is the same as a P2PKH script but starts with an additional OP_DROP. This way we can put an additional public key to the input script so this one would be used for the block signature validation. The OP_DROP will remove the additional pubkey directly so it would stay spendable with the stakers signature. There could even be an OP_IF to check for the height of the stack so that the OP_DROP is only executed if the height is 3. This way the user can spend the utxo with an normal P2PKH input script

Currently:
Output: OP_DUP OP_HASH160 [ staker_pub ] OP_EQUALVERIFY OP_CHECKSIG
Input: [staker_sig] [staker_pub]
The the staker_pub is the top of the stack so it will use this one for the block signature

Alternative Script 1:
Output: OP_DROP OP_DUP OP_HASH160 [ staker_pub ] OP_EQUALVERIFY OP_CHECKSIG
Input: [staker_sig] [staker_pub] [delegate_pub]

Alternative Script 2:
Output: OP_DEPTH [3] OP_EQUAL OP_IF OP_DROP OP_ENDIF OP_DUP OP_HASH160 [ staker_pub ] OP_EQUALVERIFY OP_CHECKSIG
Input: [staker_sig] [staker_pub] [delegate_pub]

@canguruhh
Copy link
Member

Maybe it would be easier to activate dPoS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants