Skip to content

Instantly share code, notes, and snippets.

# cook your code here
import random
list=[]
bots=[]
duplicate = 0
for i in range(2000):
r=random.randint(1,1000)
if list.count(r) < 2:

Pseudonym Pairs: A foundation for proof-of-personhood in the web 3.0 jurisdiction

Author: BipedalJoe, Year 18

Pseudonym Pairs is a dApp for global proof-of-personhood, through monthly pseudonym events that last 20 minutes, where every single person on Earth is randomly paired together with another person, 1-on-1, to verify that the other is a person, in a pseudo-anonymous context. The events provide NYM tokens, global personhood tokens, untraceable from month to month and disposable, a sort of “temporary access tokens” similar to festival bracelets. The proof-of-personhood is that you are with the same person for the whole event.

1-on-1 verification of (pseudo-anonymous) personhood

Within the 1-on-1 pairs, people can socialize as they want, and can be seen as being employed in government positions, expected to stay within the pair for the entire duration of the pseudonym event. The 1-on-1 pairs is the standard organization, requiring mutual verification. In the case of a problem, such as a bot attacke

contract Labyrinth { function generateRandomNumber() external returns (uint) {} }
contract PseudonymPairs {
Labyrinth labyrinth = Labyrinth(0x73cf4f93b71ebceb9eeba15889c5b17887004572);
function bootstrapNetwork(address _nym) {
require(now < genesisTimestamp);
//require(msg.sender == );
sortMe(_nym);
}
contract universalShuffleAlgorithm {
mapping(uint => uint) shuffleIndex;
uint counter;
mapping(address => uint) userID;
uint totalPopulation;
uint entropy;
function pickFromHat() {
uint randomNumber = 1 + getRandomNumber(entropy) % (totalPopulation - 1 - counter);
if(shuffleIndex[randomNumber] == 0) shuffleIndex[randomNumber] = randomNumber;
userID[msg.sender] = shuffleIndex[randomNumber];
contract MazeHashFunction {
function generateRandomNumber(uint _treasureMap) view internal returns (uint) {
bytes memory randomNumber = new bytes(32);
bytes memory treasureMapInBytes = toBytes(_treasureMap);
uint8 nextByteInTreasureMap = uint8(treasureMapInBytes[31]);
uint8 pointerToNextPosition = nextByteInTreasureMap;
for(uint i = 31; i >0; i--) {
uint nextHashInLabyrinth = uint(blockhash(block.number - 1 - pointerToNextPosition));
// The shuffle algorithm is similar to Algorithm P (Shuffle) from Knuth, 1969, in turn similar to the Fisher–Yates shuffle
// from 1938. It gets the position of an object from shufflingIndex, using a random number generator, and then updates the
// index so that the same position cannot be given to another object, and does so by switching places between the object
// that was picked, and the first object in the list, exchange shufflingIndex[randomNumber] and shufflingIndex[counter].
struct ShuffleAlgorithm {
mapping(uint => uint) shufflingIndex;
uint counter;
}
ShuffleAlgorithm shuffleUtility;
// The shuffle algorithm gets the position of an object from shufflingIndex, using a random number generator,
// and then updates the index so that the same position cannot be given to another object
mapping(uint => uint[2]) shufflingIndex;
uint totalSorted;
mapping(address => uint) pseudonymID;
mapping(uint => address) pseudonymIndex;
function sortMe() atTime(State.interlude, State.pseudonymEvent) {
require(pseudonymID[msg.sender] == 0);
// The shuffle algorithm is similar to Algorithm P (Shuffle) from Knuth, 1969, in turn similar to the Fisher–Yates shuffle
// from 1938. It gets the position of an object from shufflingIndex, using a random number generator, and then updates the
// index so that the same position cannot be given to another object, and does so by switching places between the object
// that was picked, and the first object in the list, exchange shufflingIndex[randomNumber] and shufflingIndex[counter].
struct ShuffleAlgorithm {
mapping(uint => uint) shufflingIndex;
uint counter;
}
ShuffleAlgorithm shuffleUtility[3];
contract MazeHashFunction {
function generateRandomNumber(uint _treasureMap) view internal returns (uint) {
bytes memory randomNumber = new bytes(32);
bytes memory treasureMapInBytes = toBytes(_treasureMap);
uint8 nextByteInTreasureMap = uint8(treasureMapInBytes[31]);
uint8 pointerToNextPosition = nextByteInTreasureMap;
for(uint i = 31; i >0; i--) {
uint nextHashInLabyrinth = uint(blockhash(block.number - 1 - pointerToNextPosition));
contract MazeHashFunction {
function generateRandomNumber(uint _treasureMap) view internal returns (uint) {
bytes memory randomNumber = new bytes(32);
bytes memory treasureMapInBytes = toBytes(_treasureMap);
uint8 nextByteInTreasureMap = uint8(treasureMapInBytes[31]);
uint8 pointerToNextPosition = nextByteInTreasureMap;
for(uint i = 31; i >0; i--) {
uint nextHashInLabyrinth = uint(blockhash(block.number - 1 - pointerToNextPosition));