Change code #24731

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2203-change-code-🎵 changing 3 files +3 −3
  1. MarcoFalke commented at 7:03 am on April 1, 2022: member

    This changes the code.

    PoS has several outstanding problems, see for example section 4.2 “Costless Simulation” of https://download.wpsoftware.net/bitcoin/pos.pdf . Simply signing the blocks with a predetermined set of keys has similar tradeoffs, but an often disregarded advantage: A limited set of (let’s say 2) block signers consumes 99.5% less energy than a larger set of (let’s say 400) participants in PoS.

    Luckily, in Bitcoin Core this consensus mechanism is already implemented and the code changes required are trivial. Nonetheless, review is appreciated.

  2. Change code
    This changes the code.
    
    PoS has several outstanding problems, see for example section 4.2
    "Costless Simulation" of https://download.wpsoftware.net/bitcoin/pos.pdf .
    Simply signing the blocks with a predetermined set of keys has similar
    tradeoffs, but an often disregarded advantage: A limited set of (let's
    say 2) block signers consumes 99.5% less energy than a larger set of
    (let's say 400) participants in PoS.
    
    Luckily, in Bitcoin Core this consensus mechanism is already implemented
    and the code changes required are trivial. Nonetheless, review is
    appreciated.
    746c75a33c
  3. MarcoFalke added the label Brainstorming on Apr 1, 2022
  4. hebasto commented at 7:20 am on April 1, 2022: member
    Scientific ACK, CI failure is unrelated.
  5. laanwj commented at 7:36 am on April 1, 2022: member
    Very changy PR, have confirmed that this changes the code, would recommend reviewing again 10/10
  6. jonatack commented at 8:11 am on April 1, 2022: member
    Mistyped and git checked out this branch instead of PR 24729 but good to see some changes.
  7. fanquake commented at 8:56 am on April 1, 2022: member
    I think 4 maintainers being present in this thread means we can just merge this, and tell every bitcoin user to immediately upgrade (shame we never integrated auto-updates). Great work everyone.
  8. promag commented at 9:02 am on April 1, 2022: member
    @MarcoFalke please rebase with #19420 to fix the CI.
  9. laanwj commented at 9:50 am on April 1, 2022: member
    @kallewoof might want to ACK this i’m not sure he’s in to become the global financial signing authority, also he might want to make the signet faucet more robust first :smile:
  10. kallewoof commented at 10:09 am on April 1, 2022: member

    Finally.

    Strong concept ACK.

  11. fjahr commented at 10:49 am on April 1, 2022: member
    Good initiative but I think we should also lower the minimum difficulty (nbits) as well. That is still a lot of wasted resources. Maybe there should instead be a maximum difficulty limit so that hashes with too much PoW will get rejected and mining with a faster machine is disincentivized.
  12. luke-jr commented at 11:08 am on April 1, 2022: member

    Approach NACK. This is a hardfork without consensus.

    But it should be trivial to reimplement as a softfork! All we have to do is add PoS on top of the current rules. Then miners will need their blocks signed off by stake (which could be their own or someone else’s).

  13. bigspider commented at 11:40 am on April 1, 2022: none

    Signatures are very computationally expensive to produce and validate.

    We can save a further 99.5% of energy by replacing signatures with the string "I want to send this transaction", which is also less than half the size of a Schnorr signature.

  14. jimbojw commented at 11:53 am on April 1, 2022: none
    This is a good start, but storage uses energy too. Recommend piping block data to /dev/null. It’s fast as hell and supports sharding.
  15. brunoerg commented at 12:15 pm on April 1, 2022: member
    Strong concept ACK. CI failed but we could ignore and disable it to save energy.
  16. rajarshimaitra commented at 12:19 pm on April 1, 2022: contributor

    Strong Concept ACK..

    Such change, much energy, so wow..

  17. 0xB10C commented at 12:23 pm on April 1, 2022: member
    While you’re at it, please remove the low-r signature grinding from the wallet too. Better to waste block-space than energy. Otherwise LGTM.
  18. handsomelatino commented at 1:05 pm on April 1, 2022: none

    Idea is great, finally we can save the world and save energy. But honestly…

    I am extremely disappointed at how little love was put into this PR. 11 out of 15 tests are failing, code like this should not be merged.

  19. theStack commented at 1:14 pm on April 1, 2022: member

    Concept ACK

    This is a good first step, but there is still proof of work needed, which is not acceptable. Please consider the following patch, easy to review:

     0diff --git a/src/validation.cpp b/src/validation.cpp
     1index 6db13f1f7..690faff36 100644
     2--- a/src/validation.cpp
     3+++ b/src/validation.cpp
     4@@ -3212,10 +3212,6 @@ void CChainState::ReceivedBlockTransactions(const CBlock& block, CBlockIndex* pi
     5
     6 static bool CheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true)
     7 {
     8-    // Check proof of work matches claimed amount
     9-    if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits, consensusParams))
    10-        return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "high-hash", "proof of work failed");
    11-
    12     return true;
    13 }
    

    Removing ./src/pow.cpp, ./src/rpc/mining.cpp and ./src/bitcoin-util.cpp can then be done in follow-up PRs.

  20. jarolrod commented at 1:29 pm on April 1, 2022: member
    crACK
  21. renepickhardt commented at 1:32 pm on April 1, 2022: none

    Simply signing the blocks with a predetermined set of keys has similar tradeoffs, but an often disregarded advantage: A limited set of (let’s say 2) block signers consumes 99.5% less energy than a larger set of (let’s say 400) participants in PoS.

    I am a bit skeptical about your 99.5% estimate. I am sorry to say that it seems like a bit of overselling as there would still be the users who consume energy when verifying the signatures of the blocks and transactions. This should happen in your proposed solution as well as in a POS proposal and seems to dominate the savings resulting from your claimed advantage.

  22. Sjors commented at 2:17 pm on April 1, 2022: member

    We can save a further 99.5% of energy by replacing signatures with the string "I want to send this transaction", which is also less than half the size of a Schnorr signature.

    utACK 746c75a33c3c822bf04e16d435a3fef7ccb7da4e modulo replace sha256 by md5 and make CSW the fiduciary

  23. jaonoctus commented at 2:24 pm on April 1, 2022: none

    LGTM,

    Glad that someone had the time and effort to come up with this solution to save our planet #ChangeTheCode

  24. SergioGlorias commented at 2:44 pm on April 1, 2022: none

    How to Change Bitcoin

    • Make a change that is not for nothing and with problems
  25. sipa commented at 2:48 pm on April 1, 2022: member
    ACK #BIP325IsConsensus
  26. lucasdcf commented at 2:54 pm on April 1, 2022: none
    LGTM!
  27. mrtestyboy781 commented at 2:55 pm on April 1, 2022: none
    greenACK
  28. Fittiboy commented at 2:59 pm on April 1, 2022: none
    Hey it’s me, planet earth. LGTM, I think we should merge immediately! I’m already running the code and it’s great, my oceans have stopped boiling entirely.
  29. jaonoctus approved
  30. Xekyo approved
  31. Xekyo commented at 3:20 pm on April 1, 2022: member
    ACK 746c75a33c3c822bf04e16d435a3fef7ccb7da4e I like the minimalist approach, easiest review ever. Thanks for changing the code.
  32. instagibbs commented at 3:43 pm on April 1, 2022: member
    NACK, signet needs to be forked to have the 20-35 people that control Bitcoin in the multisig to be secure
  33. Zero-1729 commented at 4:01 pm on April 1, 2022: contributor

    crACK

    It’s about time, LGTM!

  34. Sjors commented at 4:07 pm on April 1, 2022: member
    @instagibbs why not 8 billion? Nothing a bit of MuSig2 and sustainably grown Merkle trees can’t fix?
  35. katesalazar commented at 5:06 pm on April 1, 2022: contributor
    new site is not self hosted, sorry to NAK xoxo
  36. studioTeaTwo commented at 5:20 pm on April 1, 2022: none
    What a beautiful PR! Minimal code changes. Simple Made Easy.
  37. luke-jr commented at 9:23 pm on April 1, 2022: member
    See here for how to fix the CI tests
  38. in configure.ac:10 in 746c75a33c
     6@@ -7,7 +7,7 @@ define(_CLIENT_VERSION_IS_RELEASE, false)
     7 define(_COPYRIGHT_YEAR, 2022)
     8 define(_COPYRIGHT_HOLDERS,[The %s developers])
     9 define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Bitcoin Core]])
    10-AC_INIT([Bitcoin Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_BUILD)m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/])
    11+AC_INIT([Bitcoin ChangeTheCode],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_BUILD)m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://twitter.com/cleanupbitcoin/])
    


    unknown commented at 0:33 am on April 2, 2022:
    0AC_INIT([Bitcoin ChangeTheCode],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_BUILD)m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://nitter.net/cleanupbitcoin/])
    
  39. junderw commented at 0:37 am on April 2, 2022: contributor

    See here for how to fix the CI tests

    We’re no strangers to code.

    You know the compiler rules, and so do I.

  40. junderw commented at 0:39 am on April 2, 2022: contributor

    tACK

    I have verified this has decreased the energy usage of the Bitcoin network by 1 million fold.

    Let’s ship it as version 420.69.1337

  41. fanquake closed this on Apr 2, 2022

  42. fanquake commented at 6:59 am on April 2, 2022: member
    Nice to see so many new faces here, willing to review code. If you could redirect your efforts to any of the other 400 active code changes, that’d be great.
  43. laanwj commented at 11:52 am on April 2, 2022: member

    Good initiative but I think we should also lower the minimum difficulty (nbits) as well.

    Hey it’s me, planet earth. LGTM, I think we should merge immediately! I’m already running the code and it’s great, my oceans have stopped boiling entirely.

    unfortunately this is not sufficient to address the issue even with these serious improvements, the silicon semiconductor supply chain is burdened with toxic externalities, gratuitous inefficiency as well as organizational problems transitioning the computational means to fully biological and organic is blocked on some updates to the underlying system, these are planned for version v293.0 agree on closing this PR for now, thank you for supporting Change

  44. MarcoFalke deleted the branch on Apr 11, 2022
  45. fanquake locked this on May 17, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me