Implemented STUN protocol for cryptocurrency

For the first time in the history of cryptocurrencies, is used STUN protocol to obtaining an external IP address, instead of WEB-service.

This problem is already discussed in the cryptocurrency community, for example, here:

But, without any positive outcome.

Problem description:

Bitcoin and it’s descendants (PPC, QRK, etc) – all of them uses same public WEB-server for obtain external IP.
There is two public servers, hardcoded into a wallet program:

For source code, see https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp, function GetMyExternalIP()

What is interesting: 2nd server http://www.showmyip.com is out of service nowadays. So, all Bitcoin and altcoin networks currently
dependent on single WEB-server: checkip.dyndns.org. If this server will gone, then coin network will not died, but dramatically lost stability.
This will happening, because of peers wouldn’t able to advertise (represent) another peers into network, and peer network
connectivity will be decreased.

Moreover, current WEB-mechanism for obtain external IP is based on non-standardized human-oriented text protocol.
Therefore, if site owners will modify output format, (for instance, for better reading), then all coin wallets will be unable
to parse and understand answers, and results will be as same as server down.

In addition, dyndnd.org’s owners able to analyze WEB-server logs, and collect list of IP addresses, where is running coin wallets
and request timestamps, if is not doing this right now (request signature is hardcoded and well known, and easy to distinct).
If we remember, users usually runs wallet just before start some transactions, then we aware:
analyst can correlate wallet start and transaction time, and link it to IP address.
This is serious compromise of coin users anonymity.

Our solution:

We substituted current non-standard, hard-weight (based on TCP/HTTP) protocol to protocol, based on mature standard RFC3489 (STUN),
designed especially for this purpose. See: http://en.wikipedia.org/wiki/STUN . This is lightweight, UDP-based protocol, used in SIP-based
applications (VOIP, IP-video) for 10+ years. And since it is standardized, we can use unlimited list of servers for request, and always be
sure: EmerCoin wallet can parse/understand answer from anyone.

Currently, new EMC-wallet for obtain IP address uses 47 STUN-servers, distributed worldwide, and request sequence is random. Therefore,
nobody can collect significant list if our wallets. Moreover, we performed some steps for randomize signature request, and for server is difficulty
to distinct EMC-wallet request from request, sent by IP phone or softswitch.

Therefore, we reached our goals: removed dependency from centralized server, increased network stability and provide real anonymity.

EmerCoin team.

Is this something worth implementing in peercoin?

Fuzzybear

Sent from my HTC Desire using Tapatalk 2

[quote=“FuzzyBear, post:2, topic:2792”]Is this something worth implementing in peercoin?

Fuzzybear

Sent from my HTC Desire using Tapatalk 2[/quote]

Sure. The code is open and is the closest to PeerCoin.

nullc aka Gregory Maxwell seems to think it s a “lame approach”.
the whole thread on reddit goes above my head though

[quote=“thehuntergames, post:4, topic:2792”]nullc aka Gregory Maxwell seems to think it s a “lame approach”.
the whole thread on reddit goes above my head though[/quote]

nullc says that about the solution bitcoin has: using http://checkip.dyndns.org (which is lame indeed), not about using STUN, i guess the STUN would be a non-lame solution for that problem

We took PPCoin as a basis and are grateful that we could help him.
If the Sunny King uses this code, we will be happy! :slight_smile: