Interesting that Satoshi mentions that nodes can broadcast alerts to protect against invalid blocks:
Writing about SPVs getting attacked:
One strategy to protect against this would be to accept alerts from network nodes when they detect an invalid
block, prompting the user's software to download the full block and alerted transactions to confirm the inconsistency.
https://bitcoin.org/bitcoin.pdfAlerts from network nodes raises the possibility of nodes signing an alert and including a message with a PoW hash related to what the node is storing....also, there is already a ping facility:
UniValue getconnectioncount(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getconnectioncount\n"
"\nReturns the number of connections to other nodes.\n"
"\nResult:\n"
"n (numeric) The connection count\n"
"\nExamples:\n"
+ HelpExampleCli("getconnectioncount", "")
+ HelpExampleRpc("getconnectioncount", "")
);
LOCK2(cs_main, cs_vNodes);
return (int)vNodes.size();
}
UniValue ping(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"ping\n"
"\nRequests that a ping be sent to all other nodes, to measure ping time.\n"
"Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.\n"
"Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.\n"
"\nExamples:\n"
+ HelpExampleCli("ping", "")
+ HelpExampleRpc("ping", "")
);
// Request that each node send a ping during next message processing pass
LOCK2(cs_main, cs_vNodes);
BOOST_FOREACH(CNode* pNode, vNodes) {
pNode->fPingQueued = true;
}
return NullUniValue;
So, if we could have a serial number for each node that gets downloaded, then we could ask the nodes to sign a message, compute ping times around the network, hash ping times (including some form of SHA or zero knowledge proof) & node serials (own and other peers pinged) and then sign the message.
The ping pong could then be validated against node serials in the network and that's where fakes would have trouble. You would be able to triangulate, without knowing IP addresses, peers in node networks and any fakes would standout.
OK, including the ping times are distracting. Maybe the hash of a ping just helps to create proof that a separate message hash came from a particular node within the network withing a set of peers.
So, basically, the checksum needs to include a way to allow for a unique serial for each downloaded client. Then everything else is possible.
edit
there is also the question about actual data transfer between nodes. nodes should be able to sign how much data they sent and received at any given time, with the inclusion of their unique serial.
edit edit
Zk-snarks are probably the way ahead. Nodes can take their time to verify what they contain and then issue a proof every couple of hours.