What does Zero-Touch Sites, Payment Anti-Fraud and Cashflow Queues conclude, in numbers, about “Self-Referral and "Invite Friends to Unlock"”?
Answer: Chapter 2's association graph shows that devices and payment accounts identify most cheating rings, while IP subnets join 4692 accounts into one component and wrongly block 0.817 of referrals between strangers; "invite 3 to unlock" lets a self-referrer get a level listed at 299 for 67.50.
Scope of the numbers: Marked boxes separate evidence, 16 runnable Python programs, historical sources and hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.817, 4692
edges rings honest honest largest
blocked blocked strangers component
dev 0.487 0.019 0.000 8
dev+pay 0.779 0.047 0.000 8
dev+pay+net 0.995 0.820 0.817 4692
Reading: device and payment edges catch most rings and
block only family referrals among honest users; careful
rings slip through. Adding the shared-subnet edge seems to
catch almost every ring, but only because it glues thousands
of strangers behind carrier NAT into one component: it
blocks most honest referrals between strangers too.Show the full program
# Chapter 2. [p03] Blocking self-referral with an association graph.
# 5,000 honest users and 40 fraud rings of 3-8 accounts. Every account
# has a device fingerprint, a payment account and an IP /24 subnet.
# Honest: 6% share a device with a family member, 10% share a payment
# account; subnets come from 300 mobile carrier-NAT blocks (Zipf
# weights), so strangers often share one. Rings: members share one
# device with chance 0.6, one payment account with chance 0.7, one
# subnet with chance 0.9; a careful ring (chance 0.2) shares nothing.
# Honest users make 3,000 referrals (30% within the family); each ring
# leader refers all members. Union-find joins accounts linked by the
# chosen edge types; a referral is blocked when both ends share a
# component. Reported: rings' referrals blocked, honest ones blocked
# (all, and to strangers only), and the largest component.
import random
class DSU:
def __init__(self, n):
self.p = list(range(n))
def find(self, x):
while self.p[x] != x:
self.p[x] = self.p[self.p[x]]
x = self.p[x]
return x
def union(self, a, b):
self.p[self.find(a)] = self.find(b)
def world(rng):
acc, fam = [], []
w = [1 / (i + 1) for i in range(300)]
for i in range(5000):
acc.append({"dev": ("d", i), "pay": ("p", i),
"net": ("n", rng.choices(range(300), w)[0])})
fam.append(i)
for i in range(0, 5000, 2):
if rng.random() < 0.06:
acc[i + 1]["dev"] = acc[i]["dev"]
if rng.random() < 0.10:
acc[i + 1]["pay"] = acc[i]["pay"]
fam[i + 1] = i
rings = []
for r in range(40):
size = rng.randint(3, 8)
careful = rng.random() < 0.2
base = len(acc)
net = ("n", rng.choices(range(300), w)[0])
for j in range(size):
a = {"dev": ("rd", r, j), "pay": ("rp", r, j),
"net": ("n", rng.choices(range(300), w)[0])}
if not careful:
if rng.random() < 0.6:
a["dev"] = ("rd", r, 0)
if rng.random() < 0.7:
a["pay"] = ("rp", r, 0)
if rng.random() < 0.9:
a["net"] = net
acc.append(a)
rings.append([(base, base + j) for j in range(1, size)])
refs = []
for _ in range(3000):
i = rng.randrange(5000)
if rng.random() < 0.3:
j = i + 1 if i % 2 == 0 else i - 1
refs.append((i, j, True))
else:
refs.append((i, rng.randrange(5000), False))
return acc, refs, [x for r in rings for x in r]
def evaluate(acc, refs, ring_refs, kinds):
d = DSU(len(acc))
first = {}
for i, a in enumerate(acc):
for k in kinds:
key = a[k]
if key in first:
d.union(i, first[key])
else:
first[key] = i
same = lambda x, y: d.find(x) == d.find(y)
caught = sum(same(a, b) for a, b in ring_refs) / len(ring_refs)
hon = sum(same(a, b) for a, b, _ in refs) / len(refs)
strangers = [(a, b) for a, b, f in refs if not f]
hs = sum(same(a, b) for a, b in strangers) / len(strangers)
sizes = {}
for i in range(len(acc)):
r = d.find(i)
sizes[r] = sizes.get(r, 0) + 1
return caught, hon, hs, max(sizes.values())
if __name__ == "__main__":
rng = random.Random(75003)
acc, refs, ring_refs = world(rng)
print(" edges rings honest honest largest")
print(" blocked blocked strangers component")
for kinds in (("dev",), ("dev", "pay"), ("dev", "pay", "net")):
c, h, hs, big = evaluate(acc, refs, ring_refs, kinds)
print(" {:18s} {:7.3f} {:7.3f} {:8.3f} {:9d}".format(
"+".join(kinds), c, h, hs, big))
print("\nReading: device and payment edges catch most rings and")
print("block only family referrals among honest users; careful")
print("rings slip through. Adding the shared-subnet edge seems to")
print("catch almost every ring, but only because it glues thousands")
print("of strangers behind carrier NAT into one component: it")
print("blocks most honest referrals between strangers too.")Single source and citation
Fan, Y. (2026). Zero-Touch Multi-Site Fault Tolerance, Payment Anti-Fraud State Machines and Passive Cashflow Queuing (Version 1.0.0), Chapter 2: Self-Referral and "Invite Friends to Unlock". 5D Library. https://doi.org/10.5281/zenodo.24090201
DOI: 10.5281/zenodo.24090201 · Read the monograph · 5DL-B-075 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026075,
author = {Fan, Yafu},
title = {Zero-Touch Multi-Site Fault Tolerance, Payment Anti-Fraud State Machines and Passive Cashflow Queuing},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090201},
url = {https://doi.org/10.5281/zenodo.24090201}
}Other chapter answers in this book
- Chapter 1 · Transfer Receipts: Deduplication, Image Hashes and Release-Then-Audit
- Chapter 3 · The Order State Machine: Exhaustive Checking and the Idempotency Window
- Chapter 4 · Thirty Sites on One Kernel: Queues and Tail Latency
- Chapter 5 · Availability: Shared Kernels, Standby Nodes and Blue-Green Draining
- Chapter 6 · Allocating Traffic, Promoting Domains and Holding Cash
- Chapter 7 · Matched Tallies, Banknote Seals and Liu Yan's Canal
- Chapter 8 · A Nine-Flag Audit and a Pre-Registered Experiment