Bitcoin Forum
May 09, 2024, 04:45:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: About GetMyExternalIP on v0.1  (Read 103 times)
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1512
Merit: 7359


Farewell, Leo


View Profile
March 04, 2021, 11:33:51 AM
Merited by ABCbits (1)
 #1

Satoshi's code included GetMyExternalIP, a boolean function on net.cpp. What seems curious to me is that he/she used one IP address. This creates me the following queries:
  • Did this server manage to distribute the information of all nodes? Like their IP addresses? RPC didn't exist on that early release, it was added later so you couldn't add a node with addnode. In a way, if it did, bitcoin's information was distributed from a server. The distribution was centralized. Once you connected with 72.233.89.199:80, it wouldn't matter, but you've have to connect with Satoshi's IP first. Since RPC did not exist, it was like vSeeds.
  • Isn't this Satoshi's IP? Couldn't he/she be located that way? It is a mainnet IP address.

Code:
bool GetMyExternalIP(unsigned int& ipRet)
{
    CAddress addrConnect("72.233.89.199:80"); // whatismyip.com 198-200

    SOCKET hSocket;
    if (!ConnectSocket(addrConnect, hSocket))
        return error("GetMyExternalIP() : connection to %s failed\n", addrConnect.ToString().c_str());

    char* pszGet =
        "GET /automation/n09230945.asp HTTP/1.1\r\n"
        "Host: www.whatismyip.com\r\n"
        "User-Agent: Bitcoin/0.1\r\n"
        "Connection: close\r\n"
        "\r\n";
    send(hSocket, pszGet, strlen(pszGet), 0);

    string strLine;
    while (RecvLine(hSocket, strLine))
    {
        if (strLine.empty())
        {
            if (!RecvLine(hSocket, strLine))
            {
                closesocket(hSocket);
                return false;
            }
            closesocket(hSocket);
            CAddress addr(strLine.c_str());
            printf("GetMyExternalIP() received [%s] %s\n", strLine.c_str(), addr.ToString().c_str());
            if (addr.ip == 0)
                return false;
            ipRet = addr.ip;
            return true;
        }
    }
    closesocket(hSocket);
    return error("GetMyExternalIP() : connection closed\n");
}

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
1715273100
Hero Member
*
Offline Offline

Posts: 1715273100

View Profile Personal Message (Offline)

Ignore
1715273100
Reply with quote  #2

1715273100
Report to moderator
1715273100
Hero Member
*
Offline Offline

Posts: 1715273100

View Profile Personal Message (Offline)

Ignore
1715273100
Reply with quote  #2

1715273100
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4177



View Profile
March 04, 2021, 11:44:27 AM
 #2

The IP address appears to belong to whatismyip.com in the past and the code just sends a request to them to get the external IP of which the request is coming from. Seems like its just used to determine the external IP of the node? IRC was used initially for them to find peers, AFAIK.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
NotATether
Legendary
*
Online Online

Activity: 1596
Merit: 6732


bitcoincleanup.com / bitmixlist.org


View Profile WWW
March 04, 2021, 12:08:44 PM
Last edit: March 04, 2021, 10:44:00 PM by NotATether
 #3

Satoshi's code included GetMyExternalIP, a boolean function on net.cpp. What seems curious to Did this server manage to distribute the information of all nodes? Like their IP addresses? RPC didn't exist on that early release, it was added later so you couldn't add a node with addnode. In a way, if it did, bitcoin's information was distributed from a server. The distribution was centralized. Once you connected with 72.233.89.199:80, it wouldn't matter, but you've have to connect with Satoshi's IP first. Since RPC did not exist, it was like vSeeds.

A GET request cannot send the server any more data than what is in the request headers. And there are no IP addresses in them.

Isn't this Satoshi's IP? Couldn't he/she be located that way? It is a mainnet IP address.

How do you know it's not just one of his ISP's IP addresses used for NAT, that is, grouping a bunch of customers together under one IP address?



A GET request cannot send the server any more data than what is in the request headers. And there are no IP addresses in them.
Are you saying that with the whatismyip.com IP, it only took the request headers?

Yes

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
March 04, 2021, 12:13:20 PM
Merited by ABCbits (2)
 #4

IRC was used initially for them to find peers, AFAIK.
Not to find peers but to find "your own" information and advertise "yourself" to others.

Your computer does not know its own IP address, the outside words does. So you have to ask someone else what your IP is. Early versions used this service and I believe some others added later to fetch your own IP address which would have been used in an addr message to advertise your own node if you wanted to listen for incoming connections.

Obviously the above method is relying on a centralized service so these days we rely on other nodes in a very decentralized way to tell us what our IP is. Each time you connect to another node it sends you back a version message that contains your IP which you can use in your future version and addr messages

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1512
Merit: 7359


Farewell, Leo


View Profile
March 04, 2021, 08:22:36 PM
 #5

The IP address appears to belong to whatismyip.com in the past and the code just sends a request to them to get the external IP of which the request is coming from.
So, bitcoin v0.1.0 could only work only when that IP was not down. Anyway, I don't think that it's that important. I don't know if the node saved the connections it received to a log file (so it wouldn't need whatismyip.com), but that version didn't last long.

A GET request cannot send the server any more data than what is in the request headers. And there are no IP addresses in them.
Are you saying that with the whatismyip.com IP, it only took the request headers?

How do you know it's not just one of his ISP's IP addresses used for NAT, that is, grouping a bunch of customers together under one IP address?
You probably can't know who exactly was, but you know that the person behind that IP was a customer. Even if it was a VPN service. Thus, you limit the people that could be. Again, though, you have no permission to ask for such information from a VPN that would be most likely closed right now. Even if we're talking about Satoshi Nakamoto.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!