There was a time
When nothing but Entropy was there.
Then came the cryptographic Proof,
And took it care.
Verifiability of Randomness,
Since genesis block,
Brings Consensus over realm vastness,
So Algorand shall not fork.
Only generous hearts will rule over Algorand realm.
Show how generous is your heart donating some ALGOs to the Rewards Pool and claim the title of Randomic Majesty of Algorand or Verifiable Majesty of Algorand.
The more generous you are, the harder will be to be dethroned.
Join AlgoRealm channel!
Play AlgoRealm on CLI web emulator by @aorumbayev.
$ poetry install # install dependencies
$ poetry shell # activate virtual environment
$ cd src # cd into source directory, to be replaced with UI webapp in future
Playing AlgoRealm from your CLI is pretty easy, just ask for help:
$ python3 algorealm.py -h
AlgoRealm, only generous heart will ever rule over Algorand. (by cusma)
Usage:
algorealm.py poem
algorealm.py dynasty [--test]
algorealm.py longevity (--crown | --sceptre) [--test]
algorealm.py braveness (--crown | --sceptre) [--test]
algorealm.py claim-majesty (--crown | --sceptre) <majesty-name> <microalgos> [--test]
algorealm.py claim-card
algorealm.py buy-order <microalgos> [--notify]
algorealm.py verify-order <seller-address>
algorealm.py sell-card
algorealm.py [--help]
Commands:
poem AlgoRealm's poem.
dynasty Print the glorious dynasty of AlgoRealm's Majesties.
longevity Print AlgoRealm's Majesties longevity.
braveness Print AlgoRealm's Majesties braveness.
claim-majesty Claim the Crown of Entropy or the Sceptre of Proof, become Majesty of Algorand.
claim-card Brake the spell and claim the AlgoRealm Card by AlgoWorld.
buy-order Place an order for the AlgoRealm Card.
verify-order Verify the partially signed AlgoRealm Card buy order.
sell-card Sell the AlgoRealm Card (paying a 10% royalty).
Options:
-n, --notify Notify the Seller about your buy order on-chain.
-t, --test TestNet mode
-h, --help
<mnemonic>
safe! Although you will only use it on you local machine, is it strongly recommended to make use of a dedicated account just to play AlgoRealm!
In case you want to give a try, you can play AlgoRealm on TestNet adding
-t
to CLI commands.
Who are the Majesties of the Algorand realm?
-
Discover it directly on Algorand blockchain
-
Discover it with your node:
$ ./goal app read --app-id 137491307 --global
- Discover it with the AlgoRealm CLI:
$ python3 algorealm.py dynasty
__ __ ___ __ __
\*) \*) \*/ (*/ (*/
\*\_\*\_|O|_/*/_/*/
\_______________/
_ __ _______ __
/ \ [ | |_ __ \ [ |
/ _ \ | | .--./) .--. | |__) | .---. ,--. | | _ .--..--.
/ ___ \ | | / /'`\;/ .'`\ \ | __ / / /__\\`'_\ : | | [ `.-. .-. |
_/ / \ \_ | | \ \._//| \__. |_| | \ \_| \__.,// | |, | | | | | | | |
|____| |____|[___].',__` '.__.'|____| |___|'.__.'\'-;__/[___][___||__||__]
( ( __))
*** DYNASTY ***
π jkbishbish claimed the Crown of Entropy
on Block: 13578171 donating: 2 microALGOs to the Rewards Pool.
πͺ jkbishbish claimed the Sceptre of Proof
on Block: 13578330 donating: 2 microALGOs to the Rewards Pool.
π tmc claimed the Crown of Entropy
on Block: 14936018 donating: 3 microALGOs to the Rewards Pool.
πͺ tmc claimed the Sceptre of Proof
on Block: 14936235 donating: 3 microALGOs to the Rewards Pool.
π nullun claimed the Crown of Entropy
on Block: 14989913 donating: 4 microALGOs to the Rewards Pool.
πͺ nullun claimed the Sceptre of Proof
on Block: 14989913 donating: 4 microALGOs to the Rewards Pool.
- Which was the longest lasting Majesty?
$ python3 algorealm.py longevity --crown
*** π RANDOMIC MAJESTY LONGEVITY ***
+--------------------+--------------------+
| Majesty Name | Longevity (blocks) |
+--------------------+--------------------+
| MillionAlgosFather | 5768768 |
| nullun | 3366046 |
| jkbishbish | 1357847 |
| Matt | 1248429 |
| renangeo | 416539 |
| ππ
ΏοΈ | 158346 |
| tmc | 53895 |
| MillionAlgosFather | 32978 |
| nullun | 3369 |
+--------------------+--------------------+
- Who is the bravest Majesty of all time?
$ python3 algorealm.py braveness --crown
*** π RANDOMIC MAJESTY BRAVENESS ***
+--------------------+-----------+
| Majesty Name | Braveness |
+--------------------+-----------+
| renangeo | 7.824 |
| MillionAlgosFather | 4.605 |
| ππ
ΏοΈ | 1.609 |
| jkbishbish | 1 |
| tmc | 0.405 |
| nullun | 0.288 |
| nullun | 0.0 |
| MillionAlgosFather | 0.0 |
| Matt | 0.0 |
+--------------------+-----------+
Braveness is based on the relative gorwth of donation amounts (
d'
,d
):
braveness = ln(d') - ln(d)
Chose your <majesty-name>
and become part of the Dynasty! Remember that to dethrone the current Majesties you must donate to the Algorand's Rewards Pool more <microalgos>
than the last donation.
$ python3 claim-majesty (--crown | --sceptre) <majesty-name> <microalgos> [--test]
mnemonic
formatting it as: "word_1 word_2 word_3 ... word_25"
and keep it safe!
The AlgoRealm Card is a unique AlgoWorld NFT Special Card, securely stored in an enchanted coffer.
Only the generous heart of the Great Majesty of Algorand will ever able to break the spell, claim the unique Special Card and trade it! So, you previously need to conquer both the Crown of Entropy and the Sceptre of Proof, ascending to AlgoRealm's throne.
The AlgoRealm Card can be claimed starting from block 16,250,000 using the command claim-card
: hold strong both the Crown and the Sceptre and keep the throne until there!
$ python3 algorealm.py claim-card [--test]
mnemonic
formatting it as: "word_1 word_2 word_3 ... word_25"
and keep it safe!
As a Buyer you can easily place a buy-order proposal to the Seller using the buy-order
command. You just need to choose the <microalgos>
amount for the buy order proposal.
Using the --notify
option the Seller will receive a notification on-chain, being acknowledged about the new buy-order proposal.
$ python3 algorealm.py buy-order <microalgos> [--notify] [--test]
mnemonic
formatting it as: "word_1 word_2 word_3 ... word_25"
and keep it safe!
As result, a Partially Signed Trade Group Transaction is created as trade.gtx
file in the algorealm.py
CLI directory. Note that there is no counter-party risk in this operation: as a Buyer you can safely send the trade.gtxn
file to the Seller, being sure that the trade will be executed if and only if the Seller will transfer the AlgoRealm Special Card to you.
As a Seller you can review and verify the buy-order proposal, validating the amounts of the trade. Place the trade.gtxn
file, received from the Buyer, in the same directory of your algorealm.py
CLI.
The verify-order
command requires your <seller-address>
as argument.
$ python3 algorealm.py verify-order <seller-address>
Some compliancy checks are performed over the trade.gtx
file before displaying the buy-order summary:
* =========================== ORDER SUMMARY =========================== *
BUYER: <BUYER_ADDRESS>
SELLER: <SELLER_ADDRESS>
AMOUNT: 1.0 ALGO
ROYALTY: 0.1 ALGO
LAST VALID BLOCK: 13184621
* ===================================================================== *
If you agree with the buy-order proposal you can sell the AlgoRealm Special Card.
As a Seller, if you agree with the buy-order proposal, you can sell your AlgoRealm Special Card using the command sell-card
.
$ python3 algorealm.py sell-card [--test]
mnemonic
formatting it as: "word_1 word_2 word_3 ... word_25"
and keep it safe!
AlgoRealm could also be a good challenge to run your own Algorand node and familiarise the goal CLI commands.
Click to expand the guidelines!
- Save the AlgoRealm Law into your node directory.
- Find out who owns the Crown of Entropy (keep the
CROWN_OWNER_ADDRESS
) and Opt-In.
$ ./goal asset send -f YOUR_ADDRESS -t YOUR_ADDRESS --assetid 137493252 -a 0
- Write the unsigned
crown_claim.txn
Applicarion Call transaction passing"str:YOUR_NAME"
as--app-arg
.
$ ./goal app call --app-id 137491307 -f YOUR_ADDRESS --app-arg "str:Crown" --app-arg "str:YOUR_NAME" -o crown_claim.txn
- Write the unsigned
crown_donation.txn
Payment transaction to the Rewards Pool specifyingYOUR_DONATION
in microALGOs. The claim will be successful ifYOUR_DONATION
is grater than the current one.
$ ./goal clerk send -f YOUR_ADDRESS -t 737777777777777777777777777777777777777777777777777UFEJ2CI -a YOUR_DONATION -o crown_donation.txn
- Write the unsigned
crown_transfer.txn
Asset Transfer transaction formCROWN_OWNER_ADDRESS
toYOUR_ADDRESS
.
$ ./goal asset send -f CROWN_OWNER_ADDRESS -t YOUR_ADDRESS --assetid 137493252 -a 1 --clawback L64GYN3IM763NDQJQD2IX35SCWQZRHWEMX55JTOUJ2PMHL6ZCMHLR4OJMU -o crown_transfer.txn
- Build the unsigned Group Transaction.
$ cat crown_claim.txn crown_donation.txn crown_transfer.txn > claim.txn
$ ./goal clerk group -i claim.txn -o claim.gtxn
- Split the Group Transaction and sign the single transactions (no longer valid if submitted as standalone).
$ ./goal clerk split -i claim.gtxn -o unsigned_claim.txn
$ ./goal clerk sign -i unsigned_claim-0.txn -o claim-0.stxn
$ ./goal clerk sign -i unsigned_claim-1.txn -o claim-1.stxn
$ ./goal clerk sign -i unsigned_claim-2.txn -p algorealm_law.teal -o claim-2.stxn
- Submit the signed Group Transaction: claim the Crown of Entropy and became the Randomic Majesty of Algorand!
$ cat claim-0.stxn claim-1.stxn claim-2.stxn > claim.sgtxn
$ ./goal clerk rawsend -f claim.sgtxn
- Save the AlgoRealm Law into your node directory.
- Find out who owns the Sceptre of Proof (keep the
SCEPTRE_OWNER_ADDRESS
) and Opt-In.
$ ./goal asset send -f YOUR_ADDRESS -t YOUR_ADDRESS --assetid 137494385 -a 0
- Write the unsigned
sceptre_claim.txn
Applicarion Call transaction passing"str:YOUR_NAME"
as--app-arg
.
$ ./goal app call --app-id 137491307 -f YOUR_ADDRESS --app-arg "str:Sceptre" --app-arg "str:YOUR_NAME" -o sceptre_claim.txn
- Write the unsigned
sceptre_donation.txn
Payment transaction to the Rewards Pool specifyingYOUR_DONATION
in microALGOs. The claim will be successful ifYOUR_DONATION
is grater than the current one.
$ ./goal clerk send -f YOUR_ADDRESS -t 737777777777777777777777777777777777777777777777777UFEJ2CI -a YOUR_DONATION -o sceptre_donation.txn
- Write the unsigned
sceptre_transfer.txn
Asset Transfer transaction formSCEPTRE_OWNER_ADDRESS
toYOUR_ADDRESS
.
$ ./goal asset send -f SCEPTRE_OWNER_ADDRESS -t YOUR_ADDRESS --assetid 137494385 -a 1 --clawback L64GYN3IM763NDQJQD2IX35SCWQZRHWEMX55JTOUJ2PMHL6ZCMHLR4OJMU -o sceptre_transfer.txn
- Build the unsigned Group Transaction.
$ cat sceptre_claim.txn sceptre_donation.txn sceptre_transfer.txn > claim.txn
$ ./goal clerk group -i claim.txn -o claim.gtxn
- Split the Group Transaction and sign the single transactions (no longer valid if submitted as standalone).
$ ./goal clerk split -i claim.gtxn -o unsigned_claim.txn
$ ./goal clerk sign -i unsigned_claim-0.txn -o claim-0.stxn
$ ./goal clerk sign -i unsigned_claim-1.txn -o claim-1.stxn
$ ./goal clerk sign -i unsigned_claim-2.txn -p algorealm_law.teal -o claim-2.stxn
- Submit the signed Group Transaction: claim the Sceptre of Proof and became the Verifiable Majesty of Algorand!
$ cat claim-0.stxn claim-1.stxn claim-2.stxn > claim.sgtxn
$ ./goal clerk rawsend -f claim.sgtxn
You can also claim and trade the AlgoRealm Special Card using the goal CLI following these instructions.
If you enjoyed AlgoRealm or find it useful as free and open source learning example, consider tipping the Dev:
XODGWLOMKUPTGL3ZV53H3GZZWMCTJVQ5B2BZICFD3STSLA2LPSH6V6RW3I
Here you find the AlgoRealm slide deck presented at Algorand's Office Hours!
Join AlgoRealm channel!
Special thanks to everyone who forked or starred the repository β€οΈ