Skip to content

odemio/algo-NFT-and-Royalties

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

                           __  __   ___   __  __                           
                           \*) \*)  \*/  (*/ (*/                           
                            \*\_\*\_|O|_/*/_/*/                            
                             \_______________/                             
      _       __                 _______                  __               
     / \     [  |               |_   __ \                [  |              
    / _ \     | |  .--./)  .--.   | |__) |  .---.  ,--.   | |  _ .--..--.  
   / ___ \    | | / /'`\;/ .'`\ \ |  __ /  / /__\\`'_\ :  | | [ `.-. .-. | 
 _/ /   \ \_  | | \ \._//| \__. |_| |  \ \_| \__.,// | |, | |  | | | | | | 
|____| |____|[___].',__`  '.__.'|____| |___|'.__.'\'-;__/[___][___||__||__]
                 ( ( __))                                                  
                                                                   by cusma

Incipit

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 never fork.

Become a Majesty of Algorand

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 with AlgoRealm CLI

1. Setup

  1. Download the algorealm.py script
  2. Install the following dependencies:
$ pip3 install docopt --upgrade
$ pip3 install msgpack --upgrade
$ pip3 install py-algorand-sdk --upgrade
  1. Create an account on PureStake and get your API token

2. How to play

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 <purestake-api-token>
  algorealm.py verify-order <purestake-api-token> <seller-address>
  algorealm.py claim-crown <purestake-api-token> <mnemonic> <majesty-name> <microalgos>
  algorealm.py claim-sceptre <purestake-api-token> <mnemonic> <majesty-name> <microalgos>
  algorealm.py claim-card <purestake-api-token> <mnemonic>
  algorealm.py buy-order <purestake-api-token> <mnemonic> <microalgos> [--notify]
  algorealm.py sell-card <purestake-api-token> <mnemonic>
  algorealm.py [--help]

Commands:
  poem             AlgoRealm's poem.
  dynasty          Print the glorious dynasty of AlgoRealm's Majesties.
  verify-order     Verify the partially signed AlgoRealm Card buy order.
  claim-crown      Claim the Crown of Entropy, become the Randomic Majesty of Algorand.
  claim-sceptre    Claim the Sceptre of Proof, become the Verifiable Majesty of Algorand.
  claim-card       Brake the spell and claim the AlgoRealm Card by AlgoWorld.
  buy-order        Place an order for the AlgoRealm Card.
  sell-card        Sell the AlgoRealm Card (paying a 10% royalty).

Options:
  -n --notify      Notify the Seller about your buy order on-chain.
  -h --help

⚠️ Keep your <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!

3. AlgoRealm Dynasty

Who are the Majesties of the Algorand realm?

  1. Discover it directly on Algorand blockchain

  2. Discover it with your node:

$ ./goal app read --app-id 137491307 --global
  1. Discover it with the AlgoRealm CLI:
$ python3 algorealm.py dynasty <purestake-api-token>
                               __  __   ___   __  __                           
                               \*) \*)  \*/  (*/ (*/                           
                                \*\_\*\_|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.

4. Claim the Crown of Entropy or the Sceptre of Proof

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 algorealm.py claim-crown <purestake-api-token> <mnemonic> <majesty-name> <microalgos>
$ python3 algorealm.py claim-sceptre <purestake-api-token> <mnemonic> <majesty-name> <microalgos>

⚠️ Enter the the <mnemonic> formatting it as: "word_1 word_2 word_3 ... word_25" and keep it safe!

5. Claim the AlgoRealm Special Card

The AlgoRealm Card is a unique AlgoWorld NFT Special Card, securely stored in an enchanted coffer.

algorealm_card

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 <purestake-api-token> <mnemonic>

⚠️ Enter the the <mnemonic> formatting it as: "word_1 word_2 word_3 ... word_25" and keep it safe!

6. Place a buy-order

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 acknowledge about the new buy-order proposal.

$ python3 algorealm.py buy-order <purestake-api-token> <mnemonic> <microalgos> [--notify]

⚠️ Enter the the <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 transfers the AlgoRealm Special Card to you.

7. Verify a buy-order

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 <purestake-api-token> <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.

8. Sell 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 <purestake-api-token> <mnemonic>

⚠️ Enter the the <mnemonic> formatting it as: "word_1 word_2 word_3 ... word_25" and keep it safe!

Play with goal CLI

AlgoRealm could also be a good challenge to run your own Algorand node and familiarise the goal CLI commands.

Click to expand the guidelines!

1. Claim the Crown of Entropy

  1. Save the AlgoRealm Law into your node directory.
  2. 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
  1. 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
  1. Write the unsigned crown_donation.txn Payment transaction to the Rewards Pool specifying YOUR_DONATION in microALGOs. The claim will be successful if YOUR_DONATION is grater than the current one.
$ ./goal clerk send -f YOUR_ADDRESS -t 737777777777777777777777777777777777777777777777777UFEJ2CI -a YOUR_DONATION -o crown_donation.txn
  1. Write the unsigned crown_transfer.txn Asset Transfer transaction form CROWN_OWNER_ADDRESS to YOUR_ADDRESS.
$ ./goal asset send -f CROWN_OWNER_ADDRESS -t YOUR_ADDRESS --assetid 137493252 -a 1 --clawback L64GYN3IM763NDQJQD2IX35SCWQZRHWEMX55JTOUJ2PMHL6ZCMHLR4OJMU -o crown_transfer.txn
  1. 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
  1. 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
  1. 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

2. Claim the Sceptre of Proof

  1. Save the AlgoRealm Law into your node directory.
  2. 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
  1. 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
  1. Write the unsigned sceptre_donation.txn Payment transaction to the Rewards Pool specifying YOUR_DONATION in microALGOs. The claim will be successful if YOUR_DONATION is grater than the current one.
$ ./goal clerk send -f YOUR_ADDRESS -t 737777777777777777777777777777777777777777777777777UFEJ2CI -a YOUR_DONATION -o sceptre_donation.txn
  1. Write the unsigned sceptre_transfer.txn Asset Transfer transaction form SCEPTRE_OWNER_ADDRESS to YOUR_ADDRESS.
$ ./goal asset send -f SCEPTRE_OWNER_ADDRESS -t YOUR_ADDRESS --assetid 137494385 -a 1 --clawback L64GYN3IM763NDQJQD2IX35SCWQZRHWEMX55JTOUJ2PMHL6ZCMHLR4OJMU -o sceptre_transfer.txn
  1. 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
  1. 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
  1. 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

3. Claim the AlgoRealm Special Card

You can also claim and trade the AlgoRealm Special Card using the goal CLI following these instructions.

Tip the Dev

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!

About

Claim the Crown and the Sceptre of Algorand Realm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%