Open 6102bitcoin opened 3 years ago
EPS style new peer for broadcasting locally in a private way
Style random-peer
from jm (but not really close, as there is no other parties here):
https://github.com/JoinMarket-Org/joinmarket-clientserver/commit/7f62bfee092a2f43c9af6fbeeca219e39f76a17f
If broadcasting through your own node, you can create dedicated tor instances https://coderwall.com/p/01_gpg/multiple-instance-of-torm, so you just renew their circuit to broadcast, instead of the main service using 9051, leaving it untouched. But following this, would need to declare the control port below, as stem will recognize the default port and use it to signal.newnym
Remove need for control port to refresh tor?
What if I say you can just not mention the port? https://github.com/txCastOrg/txCast/blob/d52b34e4758fdfce2ed2ebfc2e6fa5c6fd78c66f/txCast.py#L41 Nyx uses tor_controller port imported from Stem https://gitweb.torproject.org/nyx.git/tree/nyx/panel/header.py#n105, using the default port.
with Controller.from_port() as controller:
Interesting cheers!
random-peer
?Any advice on how to best implement random-peer?
Reading the var description again, does not fit txCast
right now, as it is possible only if there are more parties involved with the same configuration to accept it.
Great to know about the lack of need to mention the port! Does this mean we don't need to get the tor password?
If you hash the password, you need to input every time or save into a variable inside the file for organization, but this would kill the objective of hashing the password if you save it in plain text.
Using CookieAuthentication 1
solves this, no password needed, authenticate will be blank
https://github.com/txCastOrg/txCast/blob/d52b34e4758fdfce2ed2ebfc2e6fa5c6fd78c66f/txCast_stagger.py#L101
controller.authenticate()
There is debate about using Cookies or Hashed password. Mention in the torrc manual.
from this:
ControlPort 9051
HashedControlPassword 16:32F851C1593A6DBC60B8E1E33AA9557B0F7A2E63297F6DCD6C18E61C50
from stem import Signal
from stem.control import Controller
with Controller.from_port(port = 9051) as controller:
controller.authenticate(password=tor_password)
controller.signal(Signal.NEWNYM)
to this
ControlPort 9051
CookieAuthentication 1
from stem import Signal
from stem.control import Controller
with Controller.from_port() as controller:
controller.authenticate()
controller.signal(Signal.NEWNYM)
Very cool what you did, as I can see, you managed to keep it compatible with different systems, but I still think it can be automated to just asking for tx at maximum. Following this, just remains to input tx:
One thing I think can be enhanced, is comparing IPs with Tor before and after signaling newnym, to check it it differentiate, this would provide 100% accuracy to check if it worked. Yes, there is this error handling, if connection was refused, maybe ok?
Actually, this is based on the exit node, and the exit node can be the same sometimes but the circuit change, this probability is lower nowadays, but won't say it is impossible. Worth checking out circuits here https://stem.torproject.org/tutorials/down_the_rabbit_hole.html
This is very useful. Thank you for doing this!