Comments (4)
@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.
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.
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.
closing from the icebox
from torba.
Related Issues (14)
- switch to cryptogrophy for generating addresses
- Improve timeout for network calls made during a reconnect or internet outage
- db indexes for any queries involved with wallet sync HOT 3
- manually manage db transactions HOT 1
- Support Blockchain Reorganization HOT 3
- make it easier for other teams to write integration tests with torba
- xpub and xprv don't match lbrycrd HOT 2
- Hashing algorithm choice HOT 5
- command to start spv server
- Comply with repository standards
- Consistent code style HOT 1
- Refactor orchstr8 to work with supported API calls
- Support sending to multisig (script) addresses
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torba.