Skip to content

Instantly share code, notes, and snippets.

@asn-d6
Created April 2, 2020 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asn-d6/99a936b0467b0cef88a677baaf0bbd04 to your computer and use it in GitHub Desktop.
Save asn-d6/99a936b0467b0cef88a677baaf0bbd04 to your computer and use it in GitHub Desktop.
# Boxes that attacker has in her botnet
ATTACKER_BOXES = [5, 50, 100, 200, 300, 400, 500, 1000]
# Successful high-effort PoW the attacker produces per second
ATTACKER_SUCCESSES_PER_SEC = [1, 5, 10, 20, 30, 50]
print("Expected Time (in seconds) Per Successful High-Effort PoW\n")
print("\tSucceses\t\t1\t\t5\t\t10\t\t20\t\t30\t\t50\n")
for n_attacker_boxes in ATTACKER_BOXES:
print("\t%d\t\t\t" % n_attacker_boxes, end="")
for attacker_success_per_sec in ATTACKER_SUCCESSES_PER_SEC:
one_box_successes_per_second = attacker_success_per_sec / n_attacker_boxes
expected_time_to_success = 1 / one_box_successes_per_second
print("%d\t\t" % expected_time_to_success, end="")
# print("For %d boxes and %d successes per second: one box does %f successes in a second" %
# (n_attacker_boxes, attacker_success_per_sec, one_box_successes_per_second))
print("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment