Research Article

Detectable, Traceable, and Manageable Blockchain Technologies BHE: An Attack Scheme against Bitcoin P2P Network

Algorithm 2

Selectively deleting TCP handshaking packets forces the victim node to establish an outgoing connection to the victim node.
Input: S = [pkt1…]: hijacked network packets. P: the set of malicious IP prefixes. dp: the ip of victim node
1: for pkt ∈ S do
2:  if pkt.ipSrc=dp and pkt.dport=8333 and pkt.payload=SYC then
3:   ipStr ←‘ ’
4:   ipStr ← Prefix(pkt.ipDst)
5:   if ipStr in P then
6:   success(pkt)
7:  else
8:   drop(pkt)
9:   end if
10:  else if pkt.ipDst=dp and pkt.sport=8333 and pkt.payload=SYC_ACK then
11:  drop(pkt)
12: else
13:  send(pkt)
14: end if
15: end for