Questions tagged [tcp]

Related to the TCP/IP protocol.

Related to the TCP/IP protocol.

16 questions
14
votes
4 answers

Why doesn’t Bitcoin use UDP to do Blockpropagation?

Bitcoin uses TCP for P2P but why is UDP not used? Modern day internet has relatively low packet loss rate so UDP is reliable. Even if some packets are dropped the peers can always request for the blocks. With TCP, the network is rather staticly…
user2584960
  • 243
  • 2
  • 4
6
votes
2 answers

Bitcoin client two-way communication

When client A opens a connection to client B, it opens its TCP connection to second client's port 8333. Is this connection solely used for A's queries and B's answers to A's query, or can B also query A using the same connection? For example, A can…
ThePiachu
  • 42,931
  • 25
  • 138
  • 347
5
votes
1 answer

Bitcoin initial communication diagram

I'm trying to understand how exactly does the Bitcoin client communicate initially with another client, as I'm making my own client and learning new things about TCP protocol. As I understand, the Bitcoin client uses the standard port (8333) as a…
ThePiachu
  • 42,931
  • 25
  • 138
  • 347
3
votes
1 answer

Can a Bitcoin node send messages to a program on the same machine?

I`m currently programming some TCP communication in my custom Bitcoin client. I am wondering if it is possible for the official client to communicate with it if they are sitting on the same machine? For example, if I'd send a version message to…
ThePiachu
  • 42,931
  • 25
  • 138
  • 347
2
votes
0 answers

How to use `blockchain.scripthash.subscribe` from a tcp socket in Electrum server

As a personal exercise I want to write a minimal copy of BTCPayServer. I decided to use Electrum server instead of a node to fetch information from the network. My final goal is to be able to track the transactions received by an address, but so far…
Andrés
  • 121
  • 1
1
vote
1 answer

SPV client TCP connection in python

I am trying to implement an SPV client in python (for my own learning). I want to start by making a simple TCP connection to a full node, but I either cannot get a response to my version message, or to my verack message if the version message goes…
anne1234
  • 33
  • 3
1
vote
1 answer

Problem with the first Initialization of my LN node, dial tcp my-external-ip:9735: connect: connection timed out

Background I was following 402 Payment Required's LN video and everything was good until the moment of the first Initialization of my LN node. I got an error: dial tcp my-external-ip:9735: connect: connection timed out. I was starting the…
1
vote
0 answers

getrawchangeaddress: dial tcp [::1]:8080: getsockopt: connection refused

I am using the decred atomic swap, and no matter what port I set the testnet to use, it says connection refused. I backpropagated the dependencies and everything seems to be working properly, what is poassibly causing the block for the tcp…
Chant
  • 21
  • 2
1
vote
1 answer

what's the link between iSCSI protocol and "stratum+tcp attacks

I found a strange file under/var/tmp directory, named ietd.conf { "url" : "stratum+tcp://188.165.254.85:80", "user" : "46Z6dQ77i2qAapF4kjLXaaYKCB59eajwaZbmtyyPsxDXWyxPS5nfYoe5t4R7yTgsvT AxgE8DRwwtKiMxCmM39KCBPfEgL5b", "pass" : "x", …
1
vote
1 answer

Is it possible to read every transaction my node relays?

I'd like to add every valid transaction my node receives to my own database. At the moment, I'm using getrawmempool every second to find new transactions, and then getting the data for them using getrawtransaction. However, these bitcoin-cli queries…
inersha
  • 2,928
  • 1
  • 17
  • 41
1
vote
1 answer

Can exist bitcoin network with all nodes behind NAT?

If I run bitcoin client for the first time its try to make TCP connection with saved list of IPs and port 8333 -other nodes. If this nodes are behind NAT with IP 192.168.0.XX and public IP from the NAT router with changed from NAT unknown port its…
sytolk
  • 113
  • 6
1
vote
1 answer

What is the function of the payload_checksum field in the Bitcoin protocol

According to the protocol specification at the Bitcoin wiki, each message header includes the first 4 bytes of sha256(sha256(payload) as a packet checksum. I suppose this checksum is used for packet validation, but I do not see any benefit of this,…
Jori
  • 1,580
  • 10
  • 15
1
vote
3 answers

What protocol do bitcoin nodes use to talk to each other?

I assume it's TCP, but is there some other software used to send and receive data? So how would I program a very simple C++ program that sends a test message to a node?
apchrkey
  • 53
  • 2
0
votes
1 answer

Finding wallet address on peer 2 peer network

does anyone here knows how to find the addresses from a tx object from the bitcoin protocol documentation on the peer to peer network?? in the document it says that tx message is only consist of version, flag, tx_incount, tx_in, tx_out count ,…
0
votes
1 answer

Why isnt a random port chosen for SEED node sockets?

I connected a node A to bitcoin testnet (Port 18333). The node discovery happens and I see couple of connections between my node A and the seed nodes. All of the sending and receiving happens between nodes ONLY via Port 18333 (I checked this in…
Guhan S
  • 85
  • 5
1
2