blockchain sandbox: UTXO chain, p2p mining, attacker node

This commit is contained in:
2026-07-26 20:37:26 +03:00
commit 7ce39c8964
18 changed files with 2536 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
package p2p
// Peer is the interface that any network participant must implement.
// Both honest nodes and attackers implement this — the network doesn't know the difference.
type Peer interface {
// Receive delivers a message to this peer (network layer).
Receive(msg Msg)
// ReceiveSync delivers a sync message (block sync protocol).
ReceiveSync(msg Msg)
// ShortID returns a short identifier for logging.
ShortID() string
}