Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I'm writing a small p2p network and I don't know if I have to transmit message (between nodes) in clear text or in another format ? How is it for bitcoin protocol ?
in clear text or in another format? How is it for bitcoin protocol?
In binary. With numbers mostly in little-endian byte-order. Over TCP with a conventional target port number.
The details are at https://en.bitcoin.it/wiki/Protocol_documentation
For example:
Message structure
Field Size Description Data type Comments 4 magic uint32_t Magic value indicating message origin network, and used to seek to next message when stream state is unknown 12 command char[12] ASCII string identifying the packet content, NULL padded (non-NULL padding results in packet rejected) 4 length uint32_t Length of payload in number of bytes 4 checksum uint32_t First 4 bytes of sha256(sha256(payload)) ? payload uchar[] The actual data
Unless message size and volume is important, I would instead use JSON in UTF8 for any protocol I create. You should make your own evaluation.
You might also want to consider the Gossip protocol
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments