Secure Closed Community Networks
def update_reputation(
target_reputation,
target_vote_count, # Total votes on target's action
vote_score, # 1 (upvote) or 0 (downvote)
voter_reputation,
scale_factor = 400
)
# Step 1: Compute rating difference
rating_diff = voter_reputation - target_reputation
# Step 2: Calculate exponent for expected score
exponent = rating_diff / scale_factor.to_f
# Step 3: Compute expected vote outcome
power_term = 10 ** exponent
denom = 1 + power_term
expected_score = 1.0 / denom
# Step 4: Compute adjustment factor
sqrt_votes = Math.sqrt(target_vote_count)
denom_adjust = 1 + sqrt_votes
adjustment_factor = 32.0 / denom_adjust
# Step 5: Update and return new reputation
score_diff = vote_score - expected_score
target_rep + adjustment_factor * score_diff
end
Community members upvote to reward positive actions or downvote to penalize negative ones.
Votes from high-rep users have more impact, with dynamic updates to prevent abuse and ensure fairness.
sign(
pow({
kind: 1060,
created_at: randomTimeUpTo2DaysInThePast(),
tags: [["p", currentCCNPubkey]],
pubkey: randomPublicKey(),
content: encryptToCcn(
bytes(
012d586a7163947e46a2b54bf634a82542f800ab685cd59019d3ec5b808178329c6c034fd8cc8bd548e12569b630710400e6c24a05d9d6b32f08522a241e936da82673160662a88bc2e532c979b15c80daeeb516bedd83994f17c81cb87595e1bca920156923300e9011f99f07c4b1849151ea24679b7d41ee37aee8c53512df20c0d080c606010b68656c6c6f20776f726c6400
)
)
}),
secretToRandomPublicKey()
)