Giter Club home page Giter Club logo

Comments (4)

eukreign avatar eukreign commented on July 22, 2024

@kaykurokawa the code you linked to appears to be calculating just for one block, no?

in the lbry implementation of torba ledger the proof of work is calculated here:
https://github.com/lbryio/lbry/blob/ee5be5adc80d4513fbd2fa26881833de3487dd54/lbrynet/wallet/header.py#L48-L78

Is what you're asking about different from that?

from torba.

kaykurokawa avatar kaykurokawa commented on July 22, 2024

Yes, and it basically just gets added to the blockchain's total proof of work like so (nChainWork):

https://github.com/lbryio/lbrycrd/blob/master/src/main.cpp#L3435

So you have some number that represents the total amount of work that have been put on a chain. The blockchain with most cumulative total work is the correct blockchain. I suppose electrum maybe doesn't bother to calculate this because they figure faking a block is expensive enough? Not sure

For our chain, it would be much cheaper to do an attack where you reorg them to the wrong chain because we have a much lower network hashrate and the difficulty adjustment kicks in much faster on a per block basis.

from torba.

eukreign avatar eukreign commented on July 22, 2024

The reason that electrum (and currently torba) do not do any of this is because it's an SPV wallet, it doesn't get to decide which chain to follow: it only sees what the SPV server makes available.

In order to actually be able to pick chains torba would need to support connecting and following more than one electrumx SPV servers at the same time and then having logic to differentiate and only follow a specific electrumx server when one of them starts following the "wrong" chain.

Long term we want to implement this for sure but I don't know when this will happen.

from torba.

alyssaoc avatar alyssaoc commented on July 22, 2024

closing from the icebox

from torba.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.