问题
I was recently reading about blockchains and am very intrigued by this technology. I had a few questions regarding blockchains:
Do Blockchains use web-sockets to transmit information between users? If yes then is the information(blocks) sent always a JSON object?
Do all users have the entire copy of the blockchain, do they each just see a partial copy of the blockchain? if yes then how big can the file get?
Also, what determines transactions/second? I read bitcoin does about 7transactions/seconds and what is needed to make them more scalable, is it coding factors such as writing a more efficient algorithm (big-O) or is it some kind of hardware limitation?
Sorry if these questions seem trivial but I am a newbie trying to learn the technology. Any help would be appreciated.
回答1:
- No, usually they use low-level protocol build on top of TCP.
- Users should have an entire copy of blockchain in order to verify transactions. Database size of Bitcoin: 200 GB, Ethereum 660 GB. You can use lightweight clients, which don't have a full copy, but in this case, you are not part of the network.
- In Bitcoin, there is a limit on block size, 1 MB. Average transaction size is about 400 bytes, so the average block contains 2000 transactions. There is no problem with increasing block size limit, this was done in Bitcoin Cash network (32 MB). But we cannot increase it to infinity since internet connection speed and transaction verification disk/CPU resources are not infinite.
来源:https://stackoverflow.com/questions/51317370/do-blockchains-contain-a-websocket-server