Skip to content

Instantly share code, notes, and snippets.

@Blauyourmind
Last active October 24, 2022 20:54
Show Gist options
  • Save Blauyourmind/e91262e559abc5dfe61c50a0684a8525 to your computer and use it in GitHub Desktop.
Save Blauyourmind/e91262e559abc5dfe61c50a0684a8525 to your computer and use it in GitHub Desktop.

x0r Consensus Puzzle Solution

Puzzle Contract

Contract Address (on the Rinkeby Testnet): 0xD53aAEa35836845f79cB103312f077a1aD4891D6

Contract Etherscan Link: https://rinkeby.etherscan.io/address/0xd53aaea35836845f79cb103312f077a1ad4891d6

PoW (Proof of Work)

The solution to PoW required submitting the correct nonce as input to the "PoW()" function in the puzzle contract. This puzzle simulates mining under PoW consensus where miners need to guess a nonce to mine a block. The correct nonce for PoW was the number of total NFTs I minted in my first two collections = 233.

PoH (Proof of History)

The solution to PoH required submitting the block numbers of the contract creation for my first two collections. This puzzle simulates PoH by involving the historical moments for my NFTs in blockchain history. My first collection was released at block 12258221, and my second collection was at block 12519938.

PoA (Proof of Authority)

The solution to PoA required submitting a transaction FROM a specific Ethereum address. This simulates PoA as only one approved signer/address could solve the puzzle. The address needed to submit a transaction was the address used in my previous scavenger hunt to host the 1/1 NFT treasure (0xCE2B95f7B8D872b9Fb2c403C9D0E4c0C1F6B1dd6). To correctly solve this puzzle, one needed to:

  1. Find the seed phrase for this address (located in the solution guide from my first scavenger hunt https://gist.github.com/Blauyourmind/e73e6cd476631c5dd47f2699638a75e2)
  2. Log into this account via Metamask and fund it with Rinkeby Test ETH
  3. Send a transaction to the puzzle contract function called "PoA()" with your personal address as the input.

SPoRA (Succinct Proofs of Random Access)

The solution to SPoRA required submitting a transaction to the contract with an exact gas price of 1559 GWEI. There were several hints at this number through the pricing of multiple pieces from my collection and the time limit on the Open Edition. Additionally, there was a secret note inside the contract code that told you what to do :)

//"SPDX-License-Identifier: UNLICENSED"
pragma solidity ^0.8.0;
// ....................................................................................................
// ....................................................................................................
// ....................................................................................................
// ........................................;++*!!????????!!**+;;.......................................
// .................................;+*?%$&&0101010101010101010&@$?*+;.................................
// .............................;*?$&10101010101010101010101010101010&@?*;.............................
// ..........................+!$&10101010101010101010101010101010101010101@?+;.........................
// .......................+?@010101010101010101010101010101010101010101010101&%+.......................
// ....................;*$0101010101010101010101&&&@@@@&&&0101010101010101010101@?;....................
// ..................;?&0101010101010101&@%?!*+;;.........;;+*?%@&0101010101010101&%+..................
// ................;?&01010101010101@%!+;.....*????????????!.....;+*%@010101010101010%+................
// ...............!&1010101010101$!+..........@0101010101010;.........;*%&1010101010101%;..............
// .............+@010101010101@!;.............$0101010101010;............;*$101010101010&!.............
// ............?101010101010%+................$1010101010101;...............;?&01010101010$;...........
// ..........;$10101010101%+..................$0101010101010;.................;!&1010101010&*..........
// .........+&1010101010$+....................$1010101010101;...................;?01010101010!.........
// ........*&101010101&*......................$0101010101010;.....................+$1010101010?........
// .......*1010101010$;.......................$1010101010101;.......................?0101010101?.......
// ......+&010101010?.........................$1010101010101;........................*&010101010!......
// .....;@101010101!..........................$0101010101010;.........................+&101010101*.....
// .....%010101010!...........................$1010101010101;..........................+&01010101&;....
// ....*010101010%............................$1010101010101;...........................*010101010?....
// ....@10101010@;............................$1010101010101;............................%010101010+...
// ...*101010101*.............................$0101010101010;............................;&10101010%...
// ...$10101010$..............................$101010101010&;.............................!10101010&;..
// ..;&10101010*..+***************************@1010101010101!***************************..;&01010101*..
// ..+01010101&;..%01010101010101010101010101010101010101010101010101010101010101010101&...$01010101?..
// ..!01010101@...%01010101010101010101010101010101010101010101010101010101010101010101@...?01010101$..
// ..?01010101%...%01010101010101010101010101010101010101010101010101010101010101010101@...*01010101@..
// ..?01010101%...%01010101010101010101010101010101010101010101010101010101010101010101@...*01010101@..
// ..?01010101%...%01010101010101010101010101010101010101010101010101010101010101010101@...!01010101@..
// ..!01010101@...%01010101010101010101010101010101010101010101010101010101010101010101@...?01010101$..
// ..+01010101&;..%01010101010101010101010101010101010101010101010101010101010101010101@...$01010101?..
// ..;&01010101!..;+++++++++++++++++++++++++++@0101010101010*+++++++++++++++++++++++++++..;101010101*..
// ...%01010101@..............................$0101010101010;.............................?10101010&;..
// ...*101010101*.............................$0101010101010;............................;&10101010?...
// ....$10101010&;............................$1010101010101;............................%01010101&;...
// ....+010101010%............................$1010101010101;...........................!010101010?....
// .....?101010101?...........................$0101010101010;..........................*101010101@;....
// .....;@010101010?..........................$1010101010101;.........................*0101010101+.....
// ......;&010101010%;........................$1010101010101;........................!0101010101*......
// .......+&010101010@+.......................$1010101010101;......................;%0101010101!.......
// ........+&010101010&!......................$1010101010101;.....................*@0101010101!........
// .........+@0101010101@*....................$0101010101010;...................;%10101010101*.........
// ..........;%01010101010$+..................$1010101010101;.................;?&0101010101@+..........
// ............!&01010101010$*;...............$1010101010101;...............+%&01010101010%;...........
// .............+$101010101010&?+.............$1010101010101;............;!@010101010101@*.............
// ...............*@0101010101010@?*;.........@1010101010101;........;+?$0101010101010&?;..............
// ................;!@10101010101010&$?*+;....+!*!!!!!!!!!**.....;*!$&10101010101010&?;................
// ..................;!@10101010101010101&$%?!*+;;;....;;;++*?%$@01010101010101010&?;..................
// .....................*%&10101010101010101010101&&&&&&010101010101010101010101$!;....................
// .......................;!$&01010101010101010101010101010101010101010101010@?+.......................
// ..........................;*%@1010101010101010101010101010101010101010&$!+..........................
// ..............................+!%@&1010101010101010101010101010101@$!+;.............................
// ..................................;+!?%@&&0101010101010101&&@$%!*;..................................
// .........................................;++**!!!!!!!!**++;;........................................
// ....................................................................................................
// ....................................................................................................
// ....................................................................................................
contract ItsAllConnected {
uint256 private correctNonce;
bytes32 private PoHResult;
bytes32 private PoAResult;
address public PoWSolver;
address public PoASolver;
address public PoHSolver;
address public SPoRASolver;
uint256 public unlockBlock;
constructor(uint256 _correctNonce, bytes32 _PoHResult, bytes32 _PoAResult, uint256 _blockOffset) {
correctNonce = _correctNonce;
PoHResult = _PoHResult;
PoAResult = _PoAResult;
unlockBlock = block.number + _blockOffset;
}
modifier isSolved(address solver){
require(solver == address(0), "ERROR: This puzzle has been solved.");
_;
}
// *** Puzzle for PoW Piece ***
function PoW(uint256 _nonceGuess) public isSolved(PoWSolver){
require(_nonceGuess == correctNonce, "ERROR: The guessed nonce is not correct.");
PoWSolver = msg.sender;
}
// *** Puzzle for PoA Piece ***
function PoA(address _yourAddress) public isSolved(PoASolver){
require(keccak256(abi.encodePacked(msg.sender)) == PoAResult, "ERROR: transaction is not from the correct sender");
PoASolver = _yourAddress;
}
// *** Puzzle for PoH Piece ***
function PoH(uint256 _firstNumber, uint256 _secondNumber) public isSolved(PoHSolver){
require(keccak256(abi.encode(_secondNumber -_firstNumber)) == PoHResult, "ERROR: incorrect numbers");
PoHSolver = msg.sender;
}
// *** Puzzle for SPoRA Piece ***
function SPoRA() public isSolved(SPoRASolver){
// hi...it's 1559
require(block.number > unlockBlock, "ERROR: the puzzle will unlock after the drop.");
require(tx.gasprice/1e9 == 1559, "ERROR: incorrect puzzle solution.");
SPoRASolver = msg.sender;
}
// View all puzzle solvers
function solvers() public view returns (address, address, address, address){
return (PoWSolver, PoASolver, PoHSolver, SPoRASolver);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment