Skip to content

Polkadot-Blockchain-Academy/PWN-tools

Repository files navigation

Polkadot Blockchain Academy

Blockchain Academy
Proof-of-Winning Tools

Included here are scripts to generate and verify a Proof-of-Winning (PWN) JSON payloads.

💻 Dependencies

PWN requires you come with:

  • 🙋 A SS58 compliant Address that you have the private key for.

The scripts depend on installations of:

These scripts gotta run 😉:

# Allow execution
chmod +x generate-proof-of-win-signature.sh generate-proof-of-win-private-key.sh verify-proof-of-win.sh

🔏 Generate PWN

😱 You would just put secrets into some random executable you found online?!

🫠 ... and put your secrets into it?!

❗❗ BEFORE YOU START, READ THE .sh SCRIPTS INCLUDED HERE! ❗❗

🏃 Running

Fire up the option you want to use, and follow the prompts - do so carefully and completely!

# Option with private key or mnemonic
./generate-proof-of-win-private-key.sh

# Option with Polkadot.js wallet
./generate-proof-of-win-signature.sh

Both scripts produce a payload file of PWN-<your SS58 address here>.json.

So as an example, PWN-14XeJg226wvHG6PWmhKUsrv5PmeccjbXwFe9pVrBbryEWeZc.json will look something like:

{
  "message": "<Bytes>I LIKE WINNING! BOOOOO YAAAAAA!</Bytes>",
  "ss58Address": "14XeJg226wvHG6PWmhKUsrv5PmeccjbXwFe9pVrBbryEWeZc",
  "secretHash": "0x58cf16bcdceec9bce18246eeaa2f3358a2cdfdb7dc98a3d5f61da18f841b057369c58e64a456e236e853d853ef088a0eb57551a2a2b124c3060d5f402a2bf0a3",
  "signature": "0x78bea5e6ae9973c9842e33c1f37109fd5a8dc4f954cd22a133756a7590fffd0363f956afd24a16a6bcb00a3ce7bfdcc8045dad80b421bd01a8948ff9d2853e8a"
}

🔎 Verify PWN

  • ./verify-proof-of-win.sh
    • This verifies a PWN json file correctly passes tests.
    • You can test this by checking the example above 😉.

🏃 Running

# Option with private key or mnemonic
./verify-proof-of-win.sh <path/to/PWN-$ADDRESS.json>

🎉 You know it's good if you get Signature verifies correctly.

😉 Otherwise you need to try again.

📬 Deliver your PWN

The Academy team will provide a place to copy& paste or upload the JSON file to assign your winnings!

License

Unlicense

About

Proof-of-Win tools for the Polkadot Blockchain Academy

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages