HackaTUM 2022 Starter Pack

Welcome to the Algorand Challenge of HackaTUM 2022!

This repository functions as an entry point and reference, to ease your deep dive into the Algorand ecosystem.

This document is structured as follows:

  1. Quickstart Instructions
  2. Tutorials
    1. Algorand Ecosystem
    2. Connect to Algorand Network
    3. Setup Sandbox for local testing
    4. Writing SmartContracts
  3. Ressources
    1. Pitch Slidedecks
    2. HackaTUM Algorand Indexer
    3. Example Smart Contract Snippets
    4. Testbed Access
  4. FAQ
  5. Reference Overview

If you want to get your hands dirty as quickly as possible, jump right into the action and follow our Quickstart Instructions. If you're completely new to Algorand, we suggest you start with a general introduction to the Algorand Ecosystem, in the Tutorials section. Of course, if you're already familiar with some of the concepts, feel free to skip what you already know.

Besides the pointers to documentation and ressources, we also provide helpful infrastructure Ressources that you can use to build your solution.

If you just want the answer to a quick question, checkout the FAQ section.

For convenience, we also provide a structured overview of links to all relevant ressources in the Reference Overview.

Happy Hacking!

P.S. Dont forget to claim your attandence token!

https://support.perawallet.app/en/article/create-a-new-algorand-account-on-pera-wallet-1ehbj11/

Quickstart Instructions in 4 steps! Should not take longer than 30 mins.

  1. Start off by having a glance at the abstract Algorand Description. You now know the basics of the ecosystem you're going to work with.

  2. Setup the Algorand Sandbox Environment. Here you can play around with existing Algorand tools in a local environment. You can also configure the sandbox tools to connect to the public Algorand networks, to access public chain data via the tool APIs. Required commands:

    • Install docker first if you dont have it: Docker install steps
    • Then, clone the repo: git clone https://github.com/algorand/sandbox.git
    • Navigate to it: cd sandbox
    • Start it: ./sandbox up
    • Check sandbox is up: docker ps
  3. If you're done playing around and want to start working on your envisioned solution, we recommend to focus on the required tools and information first. Follow our Connect to Algorand Network tutorial to decide which path to take.

  4. If you want to checkout specific transactions on the public chains, you can use the Algo Explorer. The Algorand developer docs also provide an overview of existing tools in the ecosystem.

For quick questions take a look at our FAQ.

If questions remain find us at our booth or the Algorand Challenge HQ.

Happy Hacking!

Tutorials

Algorand Ecosystem

If you're completely new to Algorand - or Blockchains in general - this is a great place to start.

Start off with a general Introduction to Blockchains to get to know the datastructure you're going to work with. If you understood the basics of Blockchain-based systems, take a look at a High-level Introduction of Algorand as an ecosystem.

Advanced: If you want to dive deeper into how Algorand consensus works on logical and network level, you can have a look at a more detailed Description of Algorand Consensus or take a look at the original Algorand Whitepaper.

Connect to Algorand Network

Your envisioned project might require that you connect to the public Algorand network. Depending on the problem you want to solve, the motivation for connecting to the network is different. To help you focus on the functionality you actually need, we discuss three typical usecases and the next important steps to get going. We choose the following three usecases:

  1. Analysis of Blockchain Data
  2. Development of SmartContracts
  3. Development of Algorand or Ecosystem Tooling

Of course, your project might require multiple or all of these things. Then just prioritize and follow them as you please.

Analysis of Blockchain Data

Your envisioned solution revolves around using and analyzing data from the Algorand Blockchain. You don't necessarily need to build tooling or write Smart Contracts. You just need data and a way to automatically retrieve and evaluate it. Fast.

First, it is important to understand how the public Algorand network is structured. Algorand operates multiple networks for different purposes. Check the Algorand Network Overview. The MainNet is where the real Algorand transactions for real monetary value are processed.

For a first glance and easy, manual lookup of data, you can use one of the Algorand Blockchain Explorers, for example the Algo Explorer.

Now you want to start automating the data access. Instead of setting up an own node to fetch all the data and offer an interface, you can instead query an instance of the Algorand Indexer. The indexer offers a REST API to search and filter Algorand blockchain data. For easier access, you can use one of the SDK client interfaces (for JavaScript, Python, Java and Go) to access the Indexer.

To make your life easier, we operate our own Indexer instance that you can directly use to get going. The indexer is availble under

  • Testnet Data - 131.159.14.109:8980
  • Mainnet Data - 131.159.14.109:8981

Development of SmartContracts

Your envisioned solution requires the development of SmartContract logic on the Algorand Blockchain. You need an easy-to-setup environment to start writing proof-of-concept code. Later you might want to test your solution against the real network.

Don't worry about the public Algorand infrastructure for now. For development of your first SmartContract, you should start in the Algorand Sandbox. The sandbox provides a containerized setup of a completely local, private Algorand network to play around with. We describe the setup in more detail in another section. If you're completely new to writing SmartContracts on Algorand, we provide more help in the dedicated tutorial.

Now your code has reached some maturity and you want to test and deploy it towards a "real network". First, check out the different node types in the Algorand ecosystem. For advanced testing you can now consider settting up a private network on your local machine (as a "more realistic sandbox"), or setting up a real node.

Algorand operates multiple networks for different purposes. For testing, your Algorand node should be connecting to the Algorand TestNet, which features a Dispenser to acquire testing currency.

Development of Algorand or Ecosystem Tooling

Your envisioned solution requires extending or directly interfacing to existing Algorand tools, APIs or SDKs. You need an API to build against and the tooling to test it. Actual transaction creation, SmartContract logic or analysis is secondary for now.

Since you plan to built with or on Algorand Tooling, you should look deeper into the Algorand ecosystem structure. Checkout how the consensus mechanism works and understand that there are multiple Algorand networks.

Take a look at the existing ecosystem projects and tools. Maybe you can use one of the existing tools to realize your idea faster.

The Algorand Developer Portal provides an overview of the existing SDKs for the ecosystem. For testing and development you want to setup the Algorand Sandbox or even install a full node to natively access the Algorand CLI tools such as goal, kmd or algokey.

If your tooling involves usage of an indexer, you can use our HackaTUM indexer node, available under

  • Testnet Data - 131.159.14.109:8980
  • Mainnet Data - 131.159.14.109:8981

Setup Sandbox for local testing

The fastest way to setup a working environment for learning and testing is to use the Algorand Sandbox environment. The sandbox provides access to all developer tools and a fresh Blockchain to work with. In its default configuration, a private network is setup insider of docker containers on your local machine. Extended installation and usage description can be found in the dedicated repository.

Writing SmartContracts

Begin by reading the Algorand Introduction of dApps.

For development of SmartContracts we recommend using PyTEAL, a smart contract language and SDK for usage with Python. This guide also assumes that you're going to use PyTEAL. Alternatively you can develop using Reach.

The PyTEAL tutorial developer pages introduce an exemplary SmartContract usecase, an autonomous NFT auction. To support your understanding, we provide a set of simpler, less complex PyTEAL smart contract examples in this repository:

  • counter.py: A simple counter that can be modified by calling the smart contract
  • voting.py: A simple voting application, that collects and displays votes
  • withdraw.py: A simple, conditional withdrawal logic

Checkout the README file contained in the contracts directory. It contains detailed instructions on how to setup the sanbox environment for and run the examples.

Tip: While reading the PyTEAL snippets, checkout python inline help for expressions (e.g. Seq, Cond, Approve, ...) to better understand coding examples.

>>> import pyteal
>>> help(pyteal)
>>> help(pyteal.Seq)
...

Advanced:

Under the hood, dApps in Algorand are running on the stack-based Algorand Virtual Machine (AVM). The AVM itself runs contracts written in the assembly-like Transaction Execution Approval Language (TEAL). Direct development or optimization using TEAL is possible, but less comfortable than using an abstraction such as PyTEAL.

Algorand also offers two types of contract logic, SmartContracts and SmartSignatures. The logic of a deployed SmartContract can be called by any node in the Algorand Blockchain. The logic of a SmartSignature is only evaluated once, during submission of the transaction which contains the logic.

Resources

Pitch Slidedecks

Link to short and long pitch slides

HackaTUM Algorand Indexer

To ease access to Algorand blockchain data, we operate a dedicated HackaTUM Algorand Indexer. The indexer offers a REST API to search and filter Algorand blockchain data. For easier access, you can use one of the SDK client interfaces (for JavaScript, Python, Java and Go) to access the Indexer.

Our indexer is available under

  • Testnet Data - 131.159.14.109:8980
  • Mainnet Data - 131.159.14.109:8981

Example Smart Contract Snippets

To make your first contact with PyTEAL easier, we provide a set of simple SmartContract examples as part of this repository. You can find an introduction and more information in our SmartContract Tutorial.

Testbed Access

Some participants might not own a laptop or a Server/VM, powerful enough to comfortably run the sandbox setup. For these teams, we offer SSH access to dedicated hardware hosts.

If your hardware doesn't do the trick for you, approach us at the booth or in the Algorand HQ room. We will allocate credentials for you.

FAQ

Where can I find the Algorand booth?

The Algorand booth is located in the entrance area of the FMI Magistrale. Look around, you cannot miss us :)

Where can I find the Algorand HQ?

The Algorand Challenge HQ is located in room 00.08.059:

https://www.ph.tum.de/about/visit/roomfinder/?room=00.08.059

See you there :)

What is a blockchain?

https://developer.algorand.org/docs/get-started/basics/what_is_blockchain/

How does the Algorand network function?

Overview:

Consensus Algorithm:

Multiple Public Networks:

Is there an easily available environment I can play around with?

Use the sandbox environment:

Try the simple SmartContract snippets from this repository.

Where can I acquire funds for account usage on the public TestNet?

Where do I start to get building?

https://developer.algorand.org/docs/get-started/basics/where_to_start/

What is a SmartContract?

https://developer.algorand.org/docs/get-started/dapps/

Detailed information: https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/

How do I write SmartContracts?

Refer to our SmartContract Tutorial.

Other Ressources:

Are there Naming Services on Algorand?

  • Algorand name service and marketplace for Non-Fungible Domains (NFDs) — unique, readable aliases for wallet addresses - NFDomains
  • ANS is a decentralized naming service. An Algorand smart contract stores names and governs the naming policy - Algorand Name Service

Which programs do I need to install?

This depends on your usecase. Choose the necessary software accordingly.

Which SDK / Editor should I use?

https://developer.algorand.org/ecosystem-projects/#algodeskio

How do I create an NFT / Token?

https://developer.algorand.org/docs/get-started/tokenization/nft/

How do I access / use on-chain data for my application?

Block Explorers: https://developer.algorand.org/ecosystem-projects/#algo-explorer

Our indexer:

What are Decentralized Identifiers?

Where do I get help on XYZ?

  • Ask on the booth/workshop room!

Reference Overview

Algorand General and Ecosystem

Decentralized Identifiers

DID Specifications

SDK

Research