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

Implement RingCT Staking #1019

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Implement RingCT Staking #1019

wants to merge 25 commits into from

Commits on Oct 30, 2022

  1. [Refactor] SetOutputs, ArrangeOutBlinds

    Moves some functionality for creating RingCT transactions into helper
    functions.
    
    Removes a duplicate error for when setting a fee of 0 fails. (Later we will
    attempt to set a fee of nFeeRet, which would be 0 in this case anyway.)
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    188bd83 View commit details
    Browse the repository at this point in the history
  2. [Refactor] Parameterize CreateCoinStake.

    Change CreateTxOuts to create the actual TxOut pointers
    rather than fill a list of TxOuts and separately extract the pointers.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    43d50f7 View commit details
    Browse the repository at this point in the history
  3. Initial RingCTStake class.

    This sets up a basic but incomplete implementation of CreateRingCTStake.
    
    Includes a weighting function that groups coins into buckets along
    powers of 16 sats, where the weight of the coin would be equal to the
    smallest value in the bucket regardless of the actual value of the coin.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    01c1ae9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e67ccd2 View commit details
    Browse the repository at this point in the history
  5. RingCT: SignStakeTx

    Refactor out the necessary vectors to store separately in the stakeinput,
    since we need them from both the input blinds and the output blinds.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    b5366b0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3c258cc View commit details
    Browse the repository at this point in the history
  7. RingCT: Refactor to isolate input/output handling.

    And allow static allocation of the context structs.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    ba6ad67 View commit details
    Browse the repository at this point in the history
  8. RingCT staking params and fixes

    Move COutputR to a common location.
    Hold a copy of COutputR in RingCTStake for its lifetime.
    Handle other memory lifetime issues.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    66f7e40 View commit details
    Browse the repository at this point in the history
  9. Fix weight calculation.

    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    d9ebfd2 View commit details
    Browse the repository at this point in the history
  10. More attempted fixes

    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    e588f97 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ce5daef View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f14b4c3 View commit details
    Browse the repository at this point in the history
  13. RingCT Stake: Sign block.

    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    d971e6c View commit details
    Browse the repository at this point in the history
  14. RingCT: Correctly mark pending spends.

    Add a helper class for resetting pending spends.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    a4b064f View commit details
    Browse the repository at this point in the history
  15. RingCT Stake: verify block signature

    and unmark pending spends if the block is not created.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    3b423c6 View commit details
    Browse the repository at this point in the history
  16. RingCT stake: Move rewards to coinbase.

    - Provide the txCoinbase to the CoinStake object for filling out
    further if necessary. (Originally, so that we could reference them in
    the coinstake, but this won't be necessary if we make them ringct to
    begin with. Still, it's easier to have in one place.)
    - Fix two misc error() calls that were broken.
    - Use blind_sum and verify_tally to confirm that the anon coin rewards
      sum to the expected number.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    727d150 View commit details
    Browse the repository at this point in the history
  17. RingCT stake: accept and load the block

    Remove some debugging statements and other cleanup.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    986c7a5 View commit details
    Browse the repository at this point in the history
  18. Alter some regtest params.

    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    4787fba View commit details
    Browse the repository at this point in the history
  19. RingCT Staking: Make hash proof match.

    - Stake uniqueness is the hash of the public key of the input.
    - Stake indexfrom is the block index at the minimum stake depth.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    52e904f View commit details
    Browse the repository at this point in the history
  20. RingCT Stake: Rangeproof the min. allowed weight.

    As the stake weight controls the hash difficulty ceiling, we can simply
    choose the lowest bracket in which the stake hash comes under the
    ceiling, and use that as our rangeproof min_value for added privacy.
    
    - Fix overflow detection when multiplying arith_uint256.
      Otherwise regtest stake targets can be a little wonky.
    - Remove an unnecessary back-and-forth cast to uint256.
    - The RingCT stake bracket weights are basically constants, so do that.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    9156bd4 View commit details
    Browse the repository at this point in the history
  21. RingCT Stake: Cleanup

    Add enable_wallet guards to similar places as existing ones.
    Remove unused stake functions from early attempts.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    d6af2ec View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    fae067a View commit details
    Browse the repository at this point in the history
  23. RingCT Stake: change required depth.

    And add include.
    Zannick committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    4b7e21f View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2022

  1. Remove unneeded try-catch.

    Zannick committed Nov 5, 2022
    Configuration menu
    Copy the full SHA
    037b458 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2023

  1. Configuration menu
    Copy the full SHA
    89822cb View commit details
    Browse the repository at this point in the history