<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paweł Pierścionek (Urtho) on Medium]]></title>
        <description><![CDATA[Stories by Paweł Pierścionek (Urtho) on Medium]]></description>
        <link>https://medium.com/@ppierscionek?source=rss-88abe1fbaaf0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nmGJbbtofCGMTW6wU3hvig.jpeg</url>
            <title>Stories by Paweł Pierścionek (Urtho) on Medium</title>
            <link>https://medium.com/@ppierscionek?source=rss-88abe1fbaaf0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 00:20:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ppierscionek/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Algorand node counting]]></title>
            <link>https://medium.com/nodely/algorand-node-counting-b55d46c26dbc?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b55d46c26dbc</guid>
            <category><![CDATA[ecology]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[algorand]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Fri, 16 May 2025 12:54:47 GMT</pubDate>
            <atom:updated>2025-05-16T15:05:31.437Z</atom:updated>
            <content:encoded><![CDATA[<p>Using Ecological Sampling Techniques</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YH408hUx4O6n4gglH5aQ7A.png" /><figcaption>Capture-recapture for Algorand node counting</figcaption></figure><h4>Intro</h4><p>One of the most challenging aspects of analyzing decentralized blockchain networks is accurately determining their size and distribution. Unlike centralized systems, where all participants are registered and known, blockchain networks consist of voluntary, pseudonymous nodes that can join or leave the network at any time. This creates significant challenges for researchers, network analysts, and the blockchain community who need reliable metrics about network composition.</p><p>This article explores a new approach to estimating the total number of full-time node equivalents in the Algorand blockchain by applying ecological sampling techniques — specifically, the Chao-1 estimator — using relay nodes as observation points. This methodology draws interesting parallels between biodiversity sampling in ecology and node discovery in distributed networks.</p><h4>Counting the nodes the old way</h4><p>As of Q2&#39;25, Algorand does not yet operate as a fully meshed P2P network and uses designated relays to propagate gossip messages. Each node maintains websocket connections to four relays at a time. The connection that has the highest cumulative buffering delay is designated to be replaced with a new, random one every four minutes.</p><p>The original node counting method assumed that all nodes have somewhat static IP addresses and connect to the network using the default behaviour. A simple, unique IP count over 24-hour period across a sample of relays (observers) proved to be a good node count estimator.</p><p>With the influx of home nodes with ephemeral IP addresses as well as short-lived liquidator bot connections, the unique node count exploded in 2024, and especially in 2025 after the incentives program went live.</p><h4>The challenge</h4><p>The simplest solution would be to change the time 24-hour window and count unique nodes within shorter, 1-hour intervals. This approach, however, introduces new challenges:</p><ul><li>Short-lived bot connections account for a significant number of unique nodes and have high time-of-day variability.</li><li>Nodes might not have enough time to randomly “hit” a designated set of observers, making the node counting highly dependent on the number of relays used for monitoring.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Gty2gm4hKlI3L-d51is2w.png" /><figcaption>Variability of hourly unique node IP count</figcaption></figure><p>A unique node count no longer provides a meaningful number in the context of a network load or environmental impact (power consumption).</p><h4>The new approach</h4><p>Let’s adopt a new KPI that counts full-time node equivalents instead of just counting ephemeral nodes. Such an indicator would more closely represent the actual size of the network and its environmental impact.</p><p>This can be solved by using a 7-day moving average of the hourly samples.</p><p>Accounting for a small or variable number of observers (relays) is a more complicated problem, similar to one that ecology researchers face when trying to estimate the total number of species in an environment without being able to count every individual. They’ve developed sophisticated statistical methods to estimate total population size based on limited samples. One such method is the Chao-1 estimator developed by Anne Chao and described in <a href="https://www.researchgate.net/publication/268975118_Non-parametric_estimation_of_the_classes_in_a_population">Non-parametric estimation of the classes in a population</a> and <a href="https://www.researchgate.net/publication/19729500_Estimating_the_Population_Size_for_Capture-Recapture_Data_with_Unequal_Catchability">Estimating the Population Size for Capture-Recapture Data with Unequal Catchability</a></p><p>The Chao-1 estimator provides a way to estimate the total number of species in a community based on the number of rare species found in a sample. The formula that allows for the calculation of the lower bound of a population size is elegantly simple:</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fmath.embed.fun%2ForP8z45dJdDHiAeNh6hmts&amp;type=text%2Fhtml&amp;schema=embed&amp;display_name=Embed+Fun&amp;src=https%3A%2F%2Fmath.embed.fun%2Fembed%2ForP8z45dJdDHiAeNh6hmts" width="200" height="155" frameborder="0" scrolling="no"><a href="https://medium.com/media/d04f77e2f33063475e3216d0b2a7d749/href">https://medium.com/media/d04f77e2f33063475e3216d0b2a7d749/href</a></iframe><p>Where <strong>S</strong>obs is the number of species (unique nodes) in the Sample, <br><strong>F</strong>1 is the number of singletons (unique nodes seen by a one relay only), <br><strong>F</strong>2 is the number of dubletons (unique nodes seen by two relays only).</p><p>This approach allows for a good lower bound estimate that does not depend on the number of observers (relays).</p><h4>Methodolgy</h4><p>Our approach adapts the Chao-1 estimator as well as sample filtering and averaging to the context of blockchain node counting:</p><ol><li><strong>Observation Points</strong>: We select a limited number of relay nodes to serve as our “observation stations.” These relays are geographically distributed to minimize regional bias.</li><li><strong>Data Collection</strong>: Each relay node logs every IP address that connects to it over a one-hour period. This becomes our sampling interval. IP address information is stored as salted hashes for GDPR compliance.</li><li><strong>Data Filtering: </strong>We ignore nodes that fail to maintain a gossip connection for over a minute to mitigate Sybil attacks.</li><li><strong>Frequency Analysis</strong>: We analyze how many unique IP hashes were seen by exactly one relay, exactly two relays, and so on.</li><li><strong>Application of Chao-1</strong>: We apply the Chao-1 formula to the intervals to account for the limited number of observers.</li><li><strong>Temporal Analysis</strong>: We repeat this process for multiple one-hour windows to account for time-of-day variations in network activity. We apply a 7-day sliding average over the 1-hour node count estimates.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cg57wsRbD7rkiwk9hPxmFA.png" /></figure><h4>Limitations and Considerations</h4><p>This methodology has several limitations that should be considered:</p><ol><li><strong>IP Address ≠ Node</strong>: An IP address is not necessarily a 1:1 mapping to a node. Some nodes may share IP addresses (if behind NAT or CGNAT).</li><li><strong>Dynamic IPs</strong>: Some nodes may change their IP addresses more frequently than 1 hour, eg, due to link issues.</li><li><strong>Hidden Nodes</strong>: Nodes configured to connect to private relays would be undercounted.</li><li><strong>Sybil Attacks</strong>: The network may contain artificially created nodes that could skew the estimate.</li><li><strong>Relay Selection Bias</strong>: The choice of relay nodes for observation may introduce bias if they are not representative of the overall network.</li></ol><p><a href="http://nodely.io/">NODELY</a> has donated resources needed to develop this new metric. <br>Real-time and historical values for full-time node count are available as <a href="https://g.nodely.io/d/network/network">Grafana dashboards</a>, as well as <a href="https://afmetrics.api.nodely.io/v1/api-docs/#get-/v1/delayed/network/nodes/count">free API</a>.</p><p>Reach out to <a href="/service/mailto:sales@nodely.io">sales team</a> if you are interested in commercial services like:</p><ul><li><a href="https://algoanalytics.api.nodely.io/v1/api-docs/#get-/v1/env/network/nodes/-date-">Historical network size / country split API for ESG compliance</a></li><li><a href="https://nodely.io/docs/solutions/validator/">Highly available virtualized validator service (staking)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b55d46c26dbc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/algorand-node-counting-b55d46c26dbc">Algorand node counting</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Benchmarking your Algorand node]]></title>
            <link>https://medium.com/nodely/benchmarking-your-algorand-node-2cd8f9ae1d22?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cd8f9ae1d22</guid>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[staking]]></category>
            <category><![CDATA[algorand]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[node]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Wed, 18 Dec 2024 11:53:12 GMT</pubDate>
            <atom:updated>2024-12-18T15:27:12.899Z</atom:updated>
            <content:encoded><![CDATA[<p>Compare your node’s performance with others</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcBzA3bDOfPwmm8J8JJ1aw.png" /></figure><h4>Why benchmark at all?</h4><p>Algorand is decentralizing rapidly, and it is up to us to ensure it becomes faster as it grows, not slower. Ideally, each new node should be faster than 50% of the others (median). This would ensure the chain has a peak performance of 10K TPS and is ready for future performance upgrades.</p><p>A public list of tested hardware configurations might also help decide which mini PC or Cloud offering is best suited for the job of running a validator node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*O-mC9CRHI6ocQSKpuIwJgA.png" /><figcaption>Node performance chart (the bigger the better)</figcaption></figure><h4>Benchmarking utility</h4><p>There is no ready, standardized utility that benchmarks Algorand workload. The closest one we can use is catchpointdump utility bundled in tools_stable package on <a href="https://github.com/algorand/go-algorand/releases">go-algorand GitHub</a>. The tool simulates fast-catchup, but the current implementation either tests database load from the network or Merkle tree calculation from a file, but not all of them in one go. Also, only recent catchpoints are available on the network, which does not help with repeatable benchmarks.</p><h4>Nodely fork of catchpointdump</h4><p>Until the benchmarking option is <a href="https://github.com/algorand/go-algorand/pull/6198">merged</a> into the main distribution, you can use Nodely’s <a href="https://github.com/AlgoNode/go-algorand/tree/urtho-benchmark">branch</a> to build the catchpointdump tool or download and use the <a href="https://github.com/AlgoNode/go-algorand/releases">prebuilt one</a>. No Windows and Mac binary releases yet.</p><h4>Running the benchmark on Linux</h4><p>This process will simulate fast-catchup by :</p><ul><li>Downloading a 5GB ledger snapshot from Nodely’s CDN</li><li>Loading the snapshot into the SQLite database</li><li>Calculating the Merkle tree hash of the account states</li></ul><p>Each stage tests for a specific aspect of the node — network speed, SSD disk /volume latency, and single-threaded CPU performance. Multi-threaded tests are not there yet.</p><p>Optionally, the benchmark can export timing and hardware configuration report to a JSON file. The file can then be sent to Nodely for comparison with other node runners and optional inclusion into a public leaderboard.</p><p>To execute the benchmark follow the steps in Linux terminal. Use the binary link matching your CPU architecture (or build the utility yourself)</p><blockquote>DO NOT RUN THIS in the data folder of your node, pick any other folder that has at <strong>least 30GB of free space</strong>.</blockquote><pre>wget https://github.com/AlgoNode/go-algorand/releases/download/0.9/catchpointdump-bench_linux_amd64.tar.gz<br>tar xvf catchpointdump-bench_linux_amd64.tar.gz<br>nohup ./catchpointdump-bench_linux_amd64/catchpointdump bench \<br>  -r 41600000 \<br>  -n mainnet.algorand.network \<br>  -p snap.nodely.io \<br>  -j report.json &amp;<br><br>tail -f nohup.out</pre><p>This might take anywhere from 30 minutes on some super-fast machines to well over 4 hours on the slow ones. You can close the terminal window, return anytime, and run the tail -f nohup to see the progress.</p><h4>Comparing the results on Nodely site</h4><p>To compare results, without making them public, just execute this command:</p><pre>curl -X POST https://benchmarks.nodely.io/api/report -d @report.json</pre><p>The command will return a link you can follow to see the results. The results can be made public, and the extra information can be amended whenever you return to this link. Best if you bookmark it.</p><h4>Interpreting the results</h4><p>Each stage of the test is measured in seconds and normalized to a point system ranging from 0 to infinity. The more points you get, the better.</p><p>Each category — Network, Disk, Single Core contributes to the overall score with a different weight. Current weights, shown below, might change in the future after the benchmark is fine-tuned. Check back once a month to recheck your scores.</p><ul><li>Network: 5%</li><li>Disk: 35%</li><li>CPU: 60%</li></ul><h4>Is my current or future node enough?</h4><p>The benchmark does not have definite thresholds that decide whether any computer is OK or not for running a node. Consider it a guide to choosing a node that is in one of 3 categories:</p><ul><li>A front runner — faster than 75% of other tested setups</li><li>A faster the others one — faster than 50% (median) of other setups</li><li>An OK one — faster than 25% of others</li></ul><p>A node that scores RED would really slow down the network, and one might consider upgrading it or joining some fun <a href="https://reti.nodely.io/">Reti pool </a>instead.</p><h4>Where is the table with all the benchmarks?</h4><p>Benchmarks will be made <a href="https://benchmarks.nodely.io/">public here</a> once there are enough public submissions. Don’t be shy and make yours public — it does not deanonymize you — unless you provide a recognizable name under your alias.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cd8f9ae1d22" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/benchmarking-your-algorand-node-2cd8f9ae1d22">Benchmarking your Algorand node</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSH Public Key authentication]]></title>
            <link>https://medium.com/nodely/ssh-public-key-authentication-51507b7080a1?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/51507b7080a1</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[ssh-agent]]></category>
            <category><![CDATA[roots]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Fri, 13 Dec 2024 13:35:11 GMT</pubDate>
            <atom:updated>2024-12-13T14:15:40.523Z</atom:updated>
            <content:encoded><![CDATA[<p>for Windows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YKRkbq4lvPHBokU_" /></figure><p>This guide shows you how to enable SSH public key login from your Windows machine for an account on your Linux server. It assumes you have password-based access to the root account there.</p><h4>Step 1 — Make sure you have the SSH client</h4><p>Open a PowerShell window by going to Start menu and typing: powershell. You can also just open a command prompt. Once there, type:</p><pre>ssh -V</pre><p>Follow any online guide to install OpenSSH client if the term <strong>ssh</strong> is not recognized.</p><h4>Step 2— Make sure you have your key pair ready</h4><p>It is recommended to have separate key-pairs for separate purposes. I recommend you generate a new one for this exercise but feel free to use one that you already have and love and skip this step.</p><p>Let’s create a new key using ED25519 algorithm — this is a new one for OpenSSH so it might not work if your OpenSSH versions are not up to date. Provide a unique name for your key so it can be identified later.</p><pre>ssh-keygen -t ed25519 -C my-key-name</pre><p>Accept the suggested location to save the key. Decline to overwrite the old one if it exists and append something like -2 to the suggested name. Provide a password to protect the key (and do not forget the password :D)</p><p>Please follow a separate guide to <a href="https://darraghoriordan.medium.com/how-to-use-ssh-with-git-and-ssh-agent-on-windows-7aeb1f64724">install an SSH-agent</a>. Otherwise ssh client might have trouble locating your new key.</p><p>Once installed and activated, you can add your new key by providing it’s full path from the previous step:</p><pre>ssh-add C:\Users\myaccount\.ssh\id_ed25519-2</pre><p>Now list your public keys and find the one with the name you provided previously:</p><pre>ssh-add -L<br><br>#ssh-ed25519 AAAA....... my-key-name</pre><p>The line with your key name is going to be needed in the following steps.</p><h4>Step 3 — Creating a privileged Linux user</h4><p>Log in as root to your Linux server and paste the following commands, replacing `manager` with your preferred account name. You may stick to the `manager` name if you are in a hurry :)</p><pre>export ACCOUNT=manager<br><br>adduser --disabled-password --gecos &quot;&quot; $ACCOUNT<br>usermod -aG sudo $ACCOUNT<br>echo &quot;$ACCOUNT ALL=(ALL) NOPASSWD: ALL&quot; &gt;&gt; /etc/sudoers.d/manager  <br>su - $ACCOUNT</pre><p>You should be logged in to the new account with the ability to run any anything as the root user using the sudo command.</p><h4>Step 4 — Authorizing your SSH key</h4><p>Execute the following commands replacing the key content between “” with your public key from step 2</p><pre>export KEY=&quot;ssh-ed25519 AAAA... my-key-name&quot;<br>mkdir .ssh<br>touch .ssh/authorized_keys<br>chmod -R og= .ssh<br>echo $KEY &gt; .ssh/authorized_keys</pre><h4>Step 5— Checking if the key works</h4><p>Try to log in using your SSH key from your Windows machine. Replace the user name before @ sign with the one chosen in step 4.</p><pre>ssh manager@YOUR.NODE.IP.ADDRESS</pre><p>This should log you in, call for help otherwise.<br>Now double check you can execute commands as root user</p><pre>sudo id<br><br>#uid=0(root) gid=0(root) groups=0(root)</pre><p>The response for `sudo id` should read root as above.</p><h4>Step 6— Disabling remote root and password login</h4><p>It is time to make your node more secure by disabling the root login.</p><pre>sudo sed -i &#39;s/PermitRootLogin yes/PermitRootLogin no/g&#39; /etc/ssh/sshd_config<br>sudo service ssh reload</pre><p>Once executed, your Linux server will not longer accept remote SSH connections for root user.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51507b7080a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/ssh-public-key-authentication-51507b7080a1">SSH Public Key authentication</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Algorand node]]></title>
            <link>https://medium.com/nodely/cloud-algorand-node-8bbc24b60a90?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bbc24b60a90</guid>
            <category><![CDATA[algorand]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[staking]]></category>
            <category><![CDATA[guide]]></category>
            <category><![CDATA[installation]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 14:44:47 GMT</pubDate>
            <atom:updated>2025-01-15T10:07:17.096Z</atom:updated>
            <content:encoded><![CDATA[<p>Quick and dirty ;)</p><h4>Who is this guide for?</h4><p>Anyone who wants to set up an Algorand node in the cloud quickly. <br>This guide focuses on ease of installation and will not make you an expert in Linux or Algorand node setup. Security best practices are addressed at the end of the guide <strong>— do not skip them.</strong></p><blockquote>You might want to go through <a href="https://medium.com/nodely/algorand-native-staking-f-a-q-b0acd87a6e4f">native staking F.A.Q. first</a>.</blockquote><h4>What is the end result?</h4><p>By following this guide, you will end up with a cloud Ubuntu Linux under $30/mo at<a href="https://my.speedypage.com/aff.php?aff=490"> SpeedyPage.com</a> running a synchronized Algorand mainnet node that is :</p><ul><li>Self-updating</li><li>Reporting telemetry to Nodely</li><li>Ready for participation configuration (key registration)</li></ul><h4>Any extra steps after this?</h4><p>If your plan is to participate in incentivized decentralization, then there will be a few extra steps:</p><ul><li><a href="https://medium.com/nodely/algorand-key-registration-cf2952d63c76">Registering your account online</a> with a key-reg transaction.</li><li><a href="https://alerts.allo.info/">Subscribing to alerts </a>to get notifications when your node misbehaves.</li><li><a href="https://medium.com/nodely/to-vrf-or-not-aabccbe3bd25">Reading up on how all this voting stuff works</a>.</li></ul><h3>THE GUIDE</h3><h4>Step 1: Getting the cloud VM</h4><p>Go and set up an account with <a href="https://my.speedypage.com/aff.php?aff=490">SpeedyPage.com</a>. They have a nice choice of locations and top-tier performance, and most importantly, they are Algorand staking-friendly. Once your account is ready proceed to “Order New Services” and choose the KVM-12G in the location of your choice. Note some regions might be more expensive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V1nPstBYrk8b1krOr34wUQ.png" /></figure><p>Once subscribed, go to Client Area and click on the green “Active” button next to your service and then click the “Open control panel” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*0EjaFg-_ZzaCXPtDEDlcLQ.png" /></figure><p>This will take you to VM management panel where you should click the “Manage” button next to your VM that is “awaiting setup” .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZEBdrKabQPgK7mFD-evww.png" /></figure><h4>Step 2: Setting up your VM</h4><p>Give your server a name and chose your time zone.<br>Next pick the Ubuntu 24.04 LTS (Noble Numbat) as the Operating System and leave the “No SSH Keys Selected” - this will be fixed later. Press “Install“ and observe how SpeedyPage installs Ubuntu in 5 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qspEosbm_kWtX95j-A84Rg.png" /></figure><h4>Step 3: Installing the Algorand node</h4><p>You should get an email with the root password in your inbox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*3OQbml4QnEdG6EFikUcskA.png" /></figure><p>Now use your favorite SSH client to log into the VM.<br>Command line SSH client (eg on Windows/Mac terminal app) can connect like this:</p><pre>ssh -o PreferredAuthentications=password root@your.node.address</pre><p>Provide the root password from your email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*ZsVoQAiLhwDm0_IdLSDTCA.png" /></figure><p>You can now install the node. Copy paste the following into the terminal for a quick install:</p><pre>echo &quot;export ALGORAND_DATA=/var/lib/algorand&quot; &gt;&gt; ~/.bashrc<br>source ~/.bashrc<br>curl -so /etc/apt/trusted.gpg.d/algorand.asc https://releases.algorand.com/key.pub <br>add-apt-repository -y &quot;deb [arch=amd64] https://releases.algorand.com/deb/ stable main&quot;<br>apt-get install -y algorand<br>sleep 20<br>goal node catchup --force</pre><p>This will install the latest official Algorand node release and set it up to auto-update. The last command requests a fast catchup that should synchronize your node in under 2 hours (or 40 minutes in the case of your Speedy node).</p><p>You can watch the progress with the command below. The synchronization is finished when “Sync Time” says “0.0s”. Press Ctrl-C to get out.</p><pre>watch goal node status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*J8PQIMDW4oQYni3EG6h5bQ.png" /></figure><p>BTW: pressing Ctrl+C will interrupt most of the scripts and return you to the command prompt.</p><h4>Step 4: Enabling telemetry</h4><p>Once your node is synchronized, you can tell it to send diagnostic information to a free <a href="https://g.nodely.io/d/telemetrymain">Nodely telemetry service.</a> Follow the OG install section of the <a href="https://nodely.io/docs/telemetry/quickstart/">telemetry setup guide</a> to enable it.</p><p>Remember to restart your Algorand node service afterward with :</p><pre>systemctl restart algorand</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKbcw2wyurzDdbC1GOFLMg.png" /></figure><h4>Step 5: Securing your node</h4><p>Suggested next tsteps:</p><ul><li>Generate a new SSH private key</li><li>Add a dedicated Linux user and enable SSH key-based login</li><li>Disable remote SSH root access</li><li>Backup your private SSH key</li><li>Enable Firewall</li><li>Enable multifactor authentication on the SpeedyPage portal</li></ul><p>Follow the <a href="https://medium.com/nodely/ssh-public-key-authentication-51507b7080a1">Windows guide here</a> to generate a public SSH key and lock down your node. Linux and Mac users might also use the guide but probably with a few tweaks.</p><blockquote>Once done, make sure to backup you key file to (Google Drive or OneDrive). Key is encrypted with your password so it is safe to store in the Cloud.</blockquote><p>If you happen to lose your key, You can always get to your Cloud VM by going to SpeedyPage control panel, enabling remote VNC access, launching a browser VNC client, and using a password from the original email. It might also be a good idea to enable multifactor authentication on SpeedyPage panel.</p><p>Please log in as your new user and execute the following commands to make sure your node utils know what folder your node keeps its data in:</p><pre>echo &quot;export ALGORAND_DATA=/var/lib/algorand&quot; &gt;&gt; ~/.bashrc<br>source ~/.bashrc</pre><p>From now on, most commands will require a sudo prefix so you can launch them with admin rights.</p><p>As the last step, let’s set up the firewall on your node. Execute the following commands to enable access only to SSH service.</p><pre>sudo ufw allow ssh<br>sudo ufw enable</pre><p>Confirm yes when asked about possible SSH disconnection.</p><p>Connections to other services will now be rejected. This does not interfere with normal node operations as a validator but might need tweaking if you want your node to become a P2P relay in 2025. There will be a dedicated guide for that once this is possible.</p><p>Review and check all the steps outlined at the top of this step.</p><h4>Step 6: Registering your stake</h4><p>You now need to register your account for voting. Key registration information is public and safe to paste into wallets, helper tools.</p><p>You can register your account with any amount of Algo. You can start with just 1 Algo and transfer more to your registered account later on. <br>Here are the next steps:</p><ul><li><a href="https://medium.com/nodely/algorand-key-registration-cf2952d63c76">Registering your account online</a> with a key-reg transaction.</li><li><a href="https://alerts.allo.info/">Subscribing to alerts </a>to get notifications when your node misbehaves.</li><li><a href="https://medium.com/nodely/to-vrf-or-not-aabccbe3bd25">Reading up on how all this voting stuff works</a>.</li></ul><h4>Step 7: Upgrading your node</h4><p>Your node is already set up to periodically update the Operating System as well as Algorand node itself. <br>You can check what is the latest available version of the node and if it is installed with this command:</p><pre>sudo apt update &amp;&amp; apt list algorand<br><br>#algorand/stable,now 3.27.0 amd64 [installed]</pre><p>You can force the update now, without waiting for the daily upgrade window by :</p><pre>sudo apt update &amp;&amp; sudo apt install -y algorand</pre><p>The node should restart itself if upgraded.</p><h4>Step 8: Maintaining your node</h4><p>Here are some helpful commands:</p><pre>#check the version of your node<br>goal -v<br><br>#restart your node<br>systemctl restart algorand<br><br>#stop your node<br>systemctl stop algorand<br><br>#start your node<br>systemctl start algorand<br><br>#status of your node<br>goal node status<br><br>#your participation key info<br>goal account partkeyinfo</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bbc24b60a90" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/cloud-algorand-node-8bbc24b60a90">Cloud Algorand node</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorand native staking F.A.Q.]]></title>
            <link>https://medium.com/nodely/algorand-native-staking-f-a-q-b0acd87a6e4f?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0acd87a6e4f</guid>
            <category><![CDATA[node-running]]></category>
            <category><![CDATA[rewards]]></category>
            <category><![CDATA[faq]]></category>
            <category><![CDATA[staking]]></category>
            <category><![CDATA[algorand]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 13:15:30 GMT</pubDate>
            <atom:updated>2024-12-23T00:20:01.497Z</atom:updated>
            <content:encoded><![CDATA[<p>Staking with your own Algorand node</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7FYYftTXHMLoymtv" /></figure><h4>Is this article for me?</h4><p>This FAQ focuses on native staking with your computer. Keep in mind there are other options as well. Native staking provides the most benefits to protocol decentralization and the node runner but requires the highest level of time and technical involvement.</p><h4>Node running F.A.Q.:</h4><p><strong>Q: Do I need to keep my node running 24/7?</strong><br>Yes, if you want to keep your eligibility at 100%.</p><blockquote>Every hour, a small random portion of accounts is challenged. Their respective nodes must respond within 10 minutes with a heartbeat. Failure to report in that window results in the account’s eligibility being revoked. One must re-register with 2 Algo fee to become eligible again. This looks scary but with a 15 minutes outage every day it might take the protocol 8 months to notice. 5h hour long sleeps on the other hand will get you suspended in a few days tops. <br>Consider registering for <a href="https://alerts.allo.info/">alerts</a> and enabling node telemetry with <a href="https://nodely.io/docs/public/telemetry">Nodely</a>.</blockquote><p><strong>Q: Do I need to run in the Cloud? Which Cloud is OK?</strong><br>Many node runners participate from home, but not every home has a stable Internet connection. Try running from home if you can spare a dedicated computer for your node. Otherwise, consider a crypto-friendly hosting provider.</p><p>You can follow <a href="https://medium.com/nodely/cloud-algorand-node-8bbc24b60a90">this guide for a quick</a>, under 90-minute setup of a Cloud staking node under $30/mo with an Algorand-friendly cloud provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*7nkyr6NwJNq-NlEoqbHIYA.png" /><figcaption>Speediest VMs for Algorand Nodes</figcaption></figure><p><strong>Q: Is my Algo locked up on the node? <br></strong>There is no lockup when you participate with your node. You move your Algo freely; you can even temporarily go below the 30K Algo threshold, and it will not revoke your eligibility. Your rewards will just be paused until you return to the required range.</p><blockquote>You can send some or all of your Algo to participate via DeFi platforms but remember that your node earns rewards only while there is at least 30K Algo in your private account.</blockquote><p><strong>Q: Are the rewards up yet? <br></strong>Protocol rewards will be up in Jan’25. Any kind of rewards that one might get for holding Algo now are not related to the permissionless incentives that will be introduced in the next protocol upgrade.</p><p><strong>Q: What happens when I go below or above the eligibility threshold?<br></strong>Going above or below just stops the rewards. No action is needed to restore rewards other than getting back within the range.</p><blockquote>Algorand protocol rewards you only if your account has been registered or unsuspended with the special 2 Algo fee, is actively voting on some node and the amount in your account is between 30K and 70M Algo.</blockquote><p><strong>Q: How do I register/connect my account /participation keys?<br></strong>Connecting your node with your account is escribed <a href="https://medium.com/nodely/algorand-key-registration-cf2952d63c76">in this guide</a>.</p><blockquote>Upcoming wallet upgrades will make this process as simple as scanning a QR code shown on the node’s terminal.</blockquote><p><strong>Q: Can I set up the node now and just wait for rewards?<br></strong>Action is required to become eligible. You will need to re-register your account with a special, one-time, 2 Algo transaction after the Algorand protocol upgrade in Jan’25.</p><blockquote>Best to wait with the node installation for the Hack-TUI utility that automates installation, fast-catchup and the key registration.</blockquote><p><strong>Q: Can I use my Windows or desktop machine for the node?<br></strong>Any computer meeting the hardware requirements will do, but not all operating system versions are designed for 100% uptime. Desktop or laptop PCs might be optimized for power saving and suspend/shutdown when idle. This may cause your eligibility to be revoked.</p><blockquote>Consider running your node on a Linux server machine at home or in the cloud that is otherwise unoccupied. This will get you closer to 100% of your potential rewards.</blockquote><p><strong>Q: What Internet connection do I need? Is 200Mbps enough?<br></strong>200Mbps downstream is enough to run an Algorand node with a participation key.</p><blockquote>You might consider a faster, symmetrical up/down, link if you plan on running your node as P2P relay later in the future.</blockquote><p><strong>Q: How long are the epochs ? When are the rewards transferred?<br></strong>Algorand protocol rewards participation immediately —directly to your account on the same block your node proposed.</p><blockquote><a href="https://reti.nodely.io/">Reti staking pools</a> have delayed rewards , paid out in epochs — as configured separately by each pool creator. You might consider using your node to host such a pool and get others to stake with your node.</blockquote><p><strong>Q: What are the penalties? What does slashing look like?<br></strong>Algorand has no deposit other than the initial 2 Algo registration fee. There are no other lockups, and no slashing if your node misbehaves.</p><blockquote>You need to re-register you account with 2 Algo fee each time it got suspended for not voting on time.</blockquote><p><strong>Q: How long is the initial node sync/catchup?<br></strong>By default, your node will do a full catchup that needs to process almost 2TB of data downloaded from the network. It might take 2 weeks unless you choose to do a fast-catchup that takes only 2 hours.</p><blockquote>Most users choose the <a href="https://developer.algorand.org/docs/run-a-node/setup/install/#sync-node-network-using-fast-catchup">fast-catchup</a> method as trust issues have been resolved with the introduction of state proofs.</blockquote><p><strong>Q: Can I store my Algo on a Ledger device? <br></strong>Yes, your Algo can be in a hardware / cold wallet and still participate.<br>There is no reason to have any private keys / Algo stored on the node.</p><blockquote>You only delegate voting rights to your node by signing participation keys using your wallet. Participation keys only allow your node to propose blocks and certify other blocks on behalf of your account but not spend any of your Algo.</blockquote><p><strong>Q: Can I copy and run my participation key on two nodes? <br></strong>No. You will lose some of your proposals (and rewards).</p><blockquote>Having more than one node for your account only looks like a nice way to guarantee availability but in reality protocol ignores such proposals as they might differ from one another. You just loose your chace to win instead of increasing it. Go to <a href="https://g.nodely.io/d/telemetrymain">Nodely telemetry</a> and look for EquivocatedVoteEvent.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0acd87a6e4f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/algorand-native-staking-f-a-q-b0acd87a6e4f">Algorand native staking F.A.Q.</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorand key registration]]></title>
            <link>https://medium.com/nodely/algorand-key-registration-cf2952d63c76?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf2952d63c76</guid>
            <category><![CDATA[algorand]]></category>
            <category><![CDATA[keyregistration]]></category>
            <category><![CDATA[algotools]]></category>
            <category><![CDATA[staking]]></category>
            <category><![CDATA[node-running]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 13:05:50 GMT</pubDate>
            <atom:updated>2024-12-06T00:11:49.927Z</atom:updated>
            <content:encoded><![CDATA[<p>Using algotools.org to submit key-registration</p><h4>When to use this guide?</h4><p>This guide is for cases where your private keys are not stored (👍) on your node, but you can sign transactions using either Lute, Defly, or Pera wallets. Please have a Linux or Mac node synced up and running before following this guide. You will also need an Algorand wallet (account) with a few Algo in it. Any amount greater than 1 Algo will do.<br>If your node is syncing for quite some time and there is no end to it in sight consider the <a href="https://developer.algorand.org/docs/run-a-node/setup/install/#sync-node-network-using-fast-catchup">Fast Catchup</a> procedure that should take around 2hrs to sync your non-archival node.</p><blockquote>This guide will be obsolete once the Hack-TUI node interface is released along with QR code keyreg signing support in above wallets.</blockquote><h4>Why is this needed?</h4><p>Key registration is needed to make your account (wallet address) participate in Algorand block validation. Once you generate and install participation keys on your node, you need to register them and repeat the procedure before they expire. This way your node can vote on your behalf without having access to your private keys outside of the registration process.</p><p>This guide will use <a href="https://algotools.org/">https://algotools.org</a> transaction creator to help with the process.</p><h4>Participation key preparation</h4><p>Make sure your node is all synced up to the mainnet tip. Check the output for “Sync Time”. It needs to read 0.0s and “Time since last block” needs to be below a few seconds. Notice the “Last committed block” value needed for the next step.</p><pre>goal node status<br><br>#Last committed block: 44702136<br>#Time since last block: 0.7s<br>#Sync Time: 0.0s<br>#Genesis ID: mainnet-v1.0</pre><p>Now generate a participation key. Skip this step if you already have it generated.</p><pre>goal account addpartkey \<br>-a YOUR0PUBLIC0WALLET0ADDRESS0WHERE0YOU0STORE0YOUR0ALGOZZZZZZ \<br>--roundFirstValid 999999999 \<br>--roundLastValid 000000000<br><br>#Please stand by while generating keys. This might take a few minutes...<br>#Participation key generation successful. <br>#Participation ID: IGPSIN77LODAYCPWSR6OV6DLVQKIESEQ2CL34BGYESOVAKPRNV2A</pre><p>Provide your account (wallet) public address as well as first and last round of the key validity period instead of 999999999/000000000:</p><ul><li>roundFirstValid is the “last committed block” value from the node status</li><li>roundLastValid = roundFirstValid + 1000000</li></ul><p>Adding 1M will give you around a month before the key expires.</p><h4>Participation key registration</h4><p>Now you need all the information on the participation key</p><pre># goal account partkeyinfo<br>Dumping participation key info from /node/data...<br><br>Participation ID:          IGPSIN77LODAYCPWSR6OV6DLVQKIESEQ2CL34BGYESOVAKPRNV2A<br>Parent address:            YKTO4C2WAC2BSMJMYKM43YCGUYHU3XHAHAYG6UUSF3BLOF6VMGRXKYB7ZU<br>First round:               44702137<br>Last round:                45702137<br>Key dilution:              1001<br>Selection key:             1WTINWXR8i7KfPAn+/E6VUfiYR7dKvDS4QnWhf/scFU=<br>Voting key:                73MByLYDxMuzMixfWi/s4vY8p8XuhW5ebzyYg2u1eNo=<br>State proof key:           GMrATdBKHeV0utHDs11jt8yQgJS0JP8Yg4sn/o+1EiBevO6jyNRC7/LeyZVY1xYqy3Y4eBpgqc7N5N+SP+ldWw==</pre><p>Pick the one that you generated in the previous step and go to <a href="https://algotools.org/">https://algotools.org</a> and connect your wallet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*yGPw9bjKnKD4ucwu5pkuWw.png" /></figure><p>Now choose the “Compose Transaction” and pick “Key Registration” for the transaction type. Copy all the details of your Participation Key to the form.<br>Data provided in the form is public in nature and will be stored openly on the chain. The AlgoTools site is just composing the transaction for you.</p><p>You can copy paste the all the fields at once like here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Y45w-MfseNd4h1Ogd0vK6A.gif" /></figure><blockquote>The whole process does not expose your private keys. Signed participation keys only have voting power and no spending rights.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*PuSfmHnQHfc_v-tTmMNLjQ.png" /></figure><p>After you press send and sign the transaction, go back to your node to check if it sees the registration.</p><pre># goal account listpartkeys<br>Registered  Account      ParticipationID   Last Used  First round  Last round<br>yes         YKTO...B7ZU  IGPSIN77...             N/A     44702137    45702137</pre><p>The registered column should read “yes” 👏 👏 👏</p><h4>Fun fact</h4><p>Your participation key is actually a bundle of thousands of quantum-resistant Falcon keys. They provide Algorand with unique features:</p><ul><li>No future quantum computer can falsify Algorand history</li><li>No amount of node runners can collude to roll back the chain</li></ul><h4>Next steps</h4><ul><li>Go and register for participation alerts at <a href="https://alerts.allo.info/">Allo Alerts</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*lDElbaSV7_ShkBx5sFDIyA.png" /><figcaption>Allo Alerts participation monitoring</figcaption></figure><ul><li>Consider monitoring your node with free telemetry service from <a href="https://nodely.io/docs/public/telemetry">Nodely</a><br>Built into Algorand node, no port forwarding is needed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*wN6EDMa4chJdnc_T5wGo_g.png" /><figcaption>Node(ly) telemetry service</figcaption></figure><ul><li><a href="https://medium.com/nodely/to-vrf-or-not-aabccbe3bd25">Go and read </a>why your node will only start voting after 320 rounds into the registration.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf2952d63c76" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/algorand-key-registration-cf2952d63c76">Algorand key registration</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorand Incentives pre-Guide]]></title>
            <link>https://medium.com/nodely/algorand-incentives-pre-guide-f242d1f681d4?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f242d1f681d4</guid>
            <category><![CDATA[algo]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[staking]]></category>
            <category><![CDATA[rewards]]></category>
            <category><![CDATA[algorand]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 12:58:15 GMT</pubDate>
            <atom:updated>2024-10-30T17:38:09.763Z</atom:updated>
            <content:encoded><![CDATA[<p>How to prepare for 2024 incentivized participation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EyMM6kBJKbeC0rnDpEF1Aw.png" /></figure><h3>Algorand staking before Q4&#39;24</h3><p>Algorand belongs to the Proof Of Stake family of blockchains and is secured by a decentralized stake and thousands of nodes run by independent operators.</p><ul><li>Neither node runners nor staking accounts are rewarded for securing the network.</li><li>Each node may vote on behalf of one or multiple accounts.</li><li>Accounts generate and sign secure participation keys that are limited only to voting activity and cannot be used for spending.</li><li>Individual account vote power and proposal frequency are proportional to the amount of Algo tokens in the account.</li><li>The stake is not locked and the proposal probability is recalculated in real-time (with 320 round lag).</li><li>There is no stake floor or ceiling — even accounts with less than one Algo can propose blocks.</li><li>DeFi &amp; Bridge smart contracts allow for liquid staking. Users can lock their stake and receive equivalent tokens that allow them to participate in DeFi activities. The same locked stake can be registered to participate (vote &amp; propose) on a user’s node.</li></ul><h3>Algorand 2024 Q4 incentives</h3><p>Q4 of 2024 introduces a fundamental change to the model with protocol-level proposal rewards. The transaction fee-powered rewards are going to be boosted by Algorand Foundation incentives for the first 3 years after launch.</p><p>Two protocol-level features are going to be the base of this new program:</p><ul><li><strong>Incentivization</strong>: Registered accounts with stake within specific bounds will be rewarded for each block proposal won.</li><li><strong>Absenteeism</strong>: Accounts that fail to propose regularly (e.g. due to node or network failure) will be removed from the staking until they re-register by paying an extra fee.</li></ul><blockquote><strong>There will be no change to the participation floor or ceiling. Both small accounts with less than 1 Algo and whales with 600 Million Algo will be able to register online for voting and proposals. New bounds will only make an account eligible for block proposal rewards.</strong></blockquote><h3>Stake eligibility for rewards</h3><p>The specific floor and ceiling that make the account eligible for rewards is yet to be decided but is expected to be</p><ul><li>30k Algo for the minimum stake (as per <a href="https://governance.algorand.foundation/governance-period-10/period-10-voting-session-1">Gov #10</a>)</li><li>70MM for the maximum stake</li></ul><p>Both minimum and maximum eligible stake values have important technical implications for network performance &amp; security and should be carefully chosen.</p><h4><strong>Minimum eligible stake</strong></h4><p>Consider some facts about the minimum/floor eligibility stake value:</p><ul><li>A low value increases the number of eligible accounts.</li><li>Tracking account eligibility is a memory-intensive task for each participating node.</li><li>Should not be increased in future releases as it might require the redeployment of pool smart contracts to maintain fair reward distribution.</li></ul><p>Technically Algorand should opt for a higher floor as it makes the chain more green by lowering the minimal node hardware requirements.</p><p>While this appears to make the process less inclusive, a decentralized staking pool smart contract could allow smaller accounts to participate in block rewards. Small stake accounts might also consider DeFi liquid staking.</p><h4><strong>Decentralized staking pools</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nwMfw12S2g7JzcgL" /></figure><p>Multiple teams are in the process of creating smart contract-based solutions to allow accounts below the minimum threshold to receive staking rewards.</p><p>Staking pools are going to introduce a lot of innovation and encourage daily engagement in the process compared to passive staking on private nodes.</p><h3>Running a private/pool validator node</h3><p>The following facts about participation might help you decide what hardware to use and where to run it.</p><ul><li>For each block, approximately 20 nodes propose blocks but only one of them wins.</li><li>Only the winning proposal is rewarded.</li><li>The block time is constantly adjusted for observed proposal arrival times, so unusually slow proposals may be ignored by the network.</li><li>Upcoming upgrades to the minimum block time might cause your proposal to be too late if your network or node is slow.</li><li>Hosting more than 4 accounts’ participation keys on a single node might delay proposals by 500ms or more.</li><li>Opting only for the upcoming peer-to-peer gossip (survival) mode without any fast relay network connections might delay the propagation of the proposal.</li><li>Hosting the same account on more than one node will lead to “equivocation” events and account proposal being ignored for the whole round. <strong>Never do this!</strong></li><li>Network transaction rate around or above 6k TPS might require more than 100Mbps of downstream Internet connection to the node.</li><li>The protocol detects offline nodes and removes their stake making sure the risk of a stall is not growing.</li></ul><h4>Private node</h4><p>Algorand network allows validators to participate with low-powered machines and does not require an ultra-fast Internet connection.</p><p>Hosting only your account that has less than 0.005% of the total online stake can be safely done on a home PC. The risks of power or network outages are mitigated by the network. A low frequency of proposals means a low probability of hitting a perfect storm that causes the proposal to be missed by the network.</p><p>While there is no risk to your stake from leaked participation keys they should be unregistered ASAP so that bad actors cannot vote on your behalf.</p><p>Running a high-stake account on the other hand should be done on a cloud machine. Prices for such a service start from $35 monthly, but do read through T&amp;C to make sure staking is allowed.</p><h4>Pool’s validator node</h4><p>It is anticipated that most pools are going to be based on permissionless contracts. In this scenario, the popularity of a pool (and the validator fees) is going to depend on the quality of the node that proposes on behalf of the whole pool.</p><p>Monitoring solutions will clearly show if pools meet the expected rewards and users will migrate to validators with higher quality.</p><p>High-stake pools are going to propose more frequently and node runners might need to invest in more expensive nodes or host only one pool per node to keep the best score.</p><p>Never run the same pool account on multiple nodes as it will lead to “equivocation” events and lost block proposal rewards.</p><h3>External resources</h3><p>This article will be updated with a list of tools and projects that can be used to streamline and monitor the decentralized Algo staking activity.</p><h4>Discussion / more info</h4><ul><li><a href="https://discord.com/channels/491256308461207573/807825288666939482">Node-runners </a>channel on #Algorand<a href="https://discord.gg/algorand"> official Discord server</a></li></ul><h4>Consensus monitoring</h4><ul><li><a href="https://alerts.allo.info/">Allo Alerts</a> : get notifications for consensus events or low-performance</li><li><a href="https://g.algonode.cloud/d/consensus/consensus?orgId=1">Nodely.io Dashboards</a> : consensus metrics dashboards</li><li><a href="https://docs.google.com/spreadsheets/d/1m5WWd_hX6nDZYhmqbqGJDQzDt98Eyhu68TeXQm7lvp8/edit#gid=0">Consensus sheet</a>: Proposal/Voting calculator</li></ul><h4>Open Source Pools</h4><ul><li>@2024–03–14 TXN Labs <a href="https://twitter.com/TxnLab/thread/1768403605860560937">announced </a>plans to develop Réti <br>— an open source solution for a smart contract based pools</li></ul><h4>Pool monitoring</h4><p>…</p><h4>Node management</h4><p>…</p><h4>Node monitoring</h4><p>…</p><h4>DeFi liquid staking</h4><p>…</p><h3>Updates</h3><h4>2024–03–15</h4><ul><li>added 30k minimum for reward eligibility</li><li>added <a href="https://twitter.com/TxnLab/thread/1768403605860560937">Réti Open Pooling</a> (TXNLabs) info</li><li>added link to <a href="https://discord.com/channels/491256308461207573/807825288666939482">node-runners</a> channel</li></ul><h4>2024–10–30</h4><ul><li>updated upper bound incentives</li><li>updated schedule</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f242d1f681d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/algorand-incentives-pre-guide-f242d1f681d4">Algorand Incentives pre-Guide</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorand transaction performance]]></title>
            <link>https://medium.com/nodely/algorand-transaction-performance-4a4f8434ac65?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a4f8434ac65</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[algorand]]></category>
            <category><![CDATA[throughput]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Fri, 29 Dec 2023 18:48:52 GMT</pubDate>
            <atom:updated>2023-12-29T19:00:24.197Z</atom:updated>
            <content:encoded><![CDATA[<p>Where any transaction counts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bNTthJSgJgAsOJX1.png" /></figure><h3>Theoretical performance</h3><p>Algorand transaction performance is limited by protocol constants. <br>The protocol is updated quarterly so it is important to reference a particular version and its settings when calculating maximum throughput.</p><p>As of Q4&#39;2023 the limits are:</p><ul><li>block size: 5MB</li><li>target block time average: 3.3 sec</li></ul><p>To calculate maximum throughput we have to assume some average transaction data length. Algorand is used in many real-world scenarios where transactions contain an additional note, like air sensor data. This causes the average transaction length to be around 350 bytes. <br>On the other hand, blocks filled with DeFi transactions (application calls) have a shorter average length of 120 bytes.</p><p>With the average TX size of 120 to 350 bytes and block time of 3.3 seconds we calculate the maximum transaction throughput to be anywhere between 4500 to 13000 TPS depending on the mix of transaction types.</p><p>It is worth noting that mainnet block #25836244 with ≤4 sec block time contained 58888 transactions — this translates to <strong>14500+ TPS</strong>.</p><h3>Transaction types</h3><p>DeFi transactions often spawn additional transactions that are the result of a smart contract execution. Such transactions are called <strong>inner transactions </strong>(or <strong>inners</strong>) and as an optimization do not have a full transaction ID assigned but only an offset within a block. This saves precious space in the block but does not demote the transaction in any way. Such transactions can be addressed individually with a block number and transaction offset.</p><h3>Calculating historical throughput</h3><p>Instead of downloading and parsing a block, it is enough to parse headers of two consecutive blocks to arrive at the transaction count per block as each block header contains both block timestamp as well as a monotonically increasing transaction count.</p><p>This protocol transaction counter includes <strong>all transaction types</strong>.</p><p>Algorand nodes are not required to have synchronized clocks and the block timestamps are rounded to 1 full second it is therefore best to calculate the throughput on 10 or 100-block intervals.</p><p>Block headers can be fetched using indexer API :</p><pre>https://mainnet-idx.algonode.cloud/v2/blocks/34801047?header-only=true<br>https://mainnet-idx.algonode.cloud/v2/blocks/34801147?header-only=true</pre><p>With headers from two blocks 34801047 and 34801147 one can infer that</p><ul><li>the transaction counter difference is <strong>1170701</strong></li><li>timestamp difference is <strong>362 </strong>seconds.</li></ul><p>This translates to an average throughput of 3234 TPS over 100 blocks.</p><p>Inner transactions in this block range constituted 0.2% of all transactions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a4f8434ac65" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/algorand-transaction-performance-4a4f8434ac65">Algorand transaction performance</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To VRF or not to Vote?]]></title>
            <link>https://medium.com/nodely/to-vrf-or-not-aabccbe3bd25?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/aabccbe3bd25</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[vrf]]></category>
            <category><![CDATA[participation]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[algorand]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Sun, 24 Sep 2023 22:44:43 GMT</pubDate>
            <atom:updated>2024-12-11T19:40:31.636Z</atom:updated>
            <content:encoded><![CDATA[<p>Or when your Algorand node casts votes on behalf of your account…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hq8JwcL2I0C-BuDF.png" /></figure><h3>VRF voting on Algorand</h3><p>Algorand uses <a href="https://developer.algorand.org/docs/get-details/algorand_consensus/">VRF</a> as the base for fast and decentralized consensus. <br>On each round, only selected nodes know it is their time to propose or vote while all other nodes can confirm and quickly verify such proposals and votes. Each proposal fights with around 20 other proposals each round and the winning one with the lowest hash is chosen and certified in two-phase voting.</p><p>Algorand accounts take part in consensus by registering online on a dedicated participating node. While the <a href="https://developer.algorand.org/docs/run-a-node/participate/">process of taking an account online</a> is fairly straightforward, some things remain unclear:</p><ul><li>What is the frequency of my votes?</li><li>When exactly does my node start and stop voting?</li><li>When is it safe to shut my node down?</li><li>Can I stop my participation by draining my account?</li><li>Can I confirm the number of my soft/cert votes?</li></ul><p>Let’s do some tests and answer all of them.</p><h3>How many votes to expect</h3><h4>Proposal frequency</h4><p>The proposal frequency is directly proportional to the fraction of the account stake vs. the total online stake. Over longer periods, an account with an average of 0.01% of the total online stake can expect to be the winning proposer for 0.01% of rounds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*jhwvOiNHof9-mvSk0VkjfA.png" /></figure><p>A large-scale observation of mainnet proposal frequency across Q2&#39;2023 shows 1:1 correlation for accounts that had no technical issues with their nodes.</p><p><strong>Example: </strong>With 1.8B Algo online the rate of proposals for an account with 10,000 Algo is going to be around 4 per month.</p><p>All of the winning proposals are written down to the ledger and can be accessed using explorers, or node API.</p><h4>Voting frequency</h4><p>Account voting power is proportional to the stake fraction but the frequency of voting has a non-linear correlation because of the underlying cryptographic sortition algorithm.</p><p>Soft and cert voting steps have different “voting frequency curves” that depend on both stake fraction and required voting committee size. Accounts with over 0.15% stake have per round soft-vote freq close to 1. This means that they vote almost every round — just with an assigned weight that is proportional to the stake fraction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*UKYlIVgKrZSJexI91uraxQ.png" /><figcaption>soft voting per round frequency</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*dCbjTQtUB67wSkgVmxFB3w.png" /><figcaption>cert voting per round frequency</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*jpk6kuvpGVAW1ggK01EWaw.png" /></figure><p>As the voting process is probabilistic the observed frequency matches the expected frequency only over sufficiently many samples (number of rounds)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*2Vget3D7q97kT3f6p1nSQQ.png" /><figcaption>A one-week mainnet soft voting performance observation</figcaption></figure><p><strong>Example: </strong>With 1.8B Algo online the rate of soft voting for an account with 10,000 Algo is going to be around 1 per 60 rounds. An account with over 1M Algo is going to soft vote every round but with more and more weight — relative to its stake fraction.</p><h4>Vote frequency is lagging …</h4><p>When you online an account or increase your stake the network is only going to “notice” this after 320 rounds. Sames goes for decreasing the stake, marking your account offline, and <strong>closing out the account.</strong></p><p>The ground rule is : your voting frequency/power always changes 320 rounds after the transaction that introduced the change gets committed to the ledger.</p><p>Participation also stops when your registration key expires — but this time exactly at the lastVotingRound from your registration transaction.</p><p><strong>Fun fact:</strong> the account’s online flag does not clear itself once your key expires. It clears as soon as there is any transaction activity on your account. There is an off-chain bot maintained by Algonode that detects expired keys and sends a 0.000001 Algo transaction with a note to both clear the online flag and notify the user that his account no longer participates.</p><p>This simple set of rules has the following non-obvious effects:</p><ul><li>Your node continues to vote for 320 rounds (~17 minutes) after you offline your account</li><li>You have to renew your registration earlier than 320 rounds before it expires to make sure it votes without interruptions.</li><li>You have to check both the online flag and the last registration key’s expiration round to make sure that an account is really participating</li><li>You can have accounts, nowhere to be seen in the ledger, casting votes for up to 17 minutes after their deletion</li><li>Registering a new participation key invalidates the previous one — there is no support for overlapping keys</li></ul><h4>Where are my votes?</h4><p>Soft votes are propagated by relays irrelevant of their timing but do not get recorded into the blockchain. Only off-chain solutions can capture and report soft voting performance using node logs or telemetry. The tools section has links to existing projects that do exactly that.</p><p>Due to network propagation delays, each node receives the cert votes in a different order but once the sum of verified vote weights gets above the 75% threshold, the round is concluded and written down in the ledger. Each node decides for itself and does not synchronize the decision with others. This makes Algorand fast but also makes it impossible to tell whose votes certified which block as nodes have different sets of recorded votes.</p><p>This might create a statistical bias in the vote certification record if proposing stake is concentrated in one geographical area. Users with slower nodes, congested network, or just far away from most proposers are going to have a lower number of cert votes recorded across nodes. It is therefore normal to see a big discrepancy between the number of casted and recorded certification votes.</p><h3>Tools worth checking out</h3><ul><li><a href="https://github.com/AlgoNode/alloctrl"><strong>Allo</strong>Ctrl</a>: Simple GUI to manage your node/account online status</li><li><a href="https://pop.allo.info/">Proofs of Participation (PoP)</a>: Participation NFTs and vote counters</li><li><a href="https://metrics.allo.info/"><strong>Allo</strong>Metrics</a>: Soft Voting performance monitoring and alerting</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aabccbe3bd25" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/to-vrf-or-not-aabccbe3bd25">To VRF or not to Vote?</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calculating balances on Algorand]]></title>
            <link>https://medium.com/nodely/calculating-the-balance-on-algorand-dea1dbd88dc5?source=rss-88abe1fbaaf0------2</link>
            <guid isPermaLink="false">https://medium.com/p/dea1dbd88dc5</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[algorand]]></category>
            <category><![CDATA[clickhouse]]></category>
            <dc:creator><![CDATA[Paweł Pierścionek (Urtho)]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 22:39:40 GMT</pubDate>
            <atom:updated>2023-07-28T14:48:07.996Z</atom:updated>
            <content:encoded><![CDATA[<p>Using SQL and TX history to get a balance snapshot at any point in time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PrgcFoOG5v0tF_TyQrBgug.png" /></figure><h3>Account balance on Algorand</h3><p>Algorand blockchain keeps both transaction (block) history as well as the current account state for all non-zero balance addresses.</p><p>Getting the balance of tokens on an account is just a single call/lookup on the Algorand Indexer SQL schema or native node API. But what if we are interested in historical data?</p><p>How quickly can we get data that shows</p><ul><li>balance history for an account</li><li>token distribution amongst holders at some round/block</li><li>a snapshot of account balance at some point in the past</li></ul><p>We get there by going through all transactions on the accounts up to the specified point in time and adding all token inflows and outflows.</p><p>Limited “time-travel” functionality is provided by Algorand Indexer API but does not work for accounts with any kind of smart contract activity on them.</p><h3>Accounting events that affect balance</h3><p>Let’s find out what inflows and outflows are possible on Algorand</p><p>Outflows:</p><ul><li>native payment or ASA token transfer</li><li>transaction fee (if covered by the account)</li><li>account close (native or ASA)</li><li>token clawback</li><li>token destroy (creator account only)</li></ul><p>Inflows:</p><ul><li>native payment or ASA token transfer</li><li>receiving end of account close operation (native or ASA)</li><li>rewards (native token only)</li><li>token clawback</li><li>token mint</li></ul><p>Notice that the transaction fee might be covered by another entity (eg smart contract) when the transaction is part of a group.</p><p>Rewards are no longer live on Algorand and as optimization are stored separately from TX history in Allo DW schema.</p><p>This article will focus on native tokens only. Queries that work with ASA are left as an exercise for the reader. :)</p><h3>Finding an interesting account</h3><p>We are interested in an account that had all types of transactions (except being closed out) over a long period of time.</p><pre>WITH tx AS ( <br>-- OUTFLOWS<br>SELECT snd_addr_id addr_id, round, 1 outflow ,0 inflow, 0 closeto<br>  FROM mainnet.txn where type_ext in (&#39;acc_payment&#39;,&#39;acc_payment_create&#39;)<br>UNION ALL<br>-- INFLOWS<br>SELECT rcv_addr_id addr_id, round, 0, 1, 0<br>  FROM mainnet.txn where type_ext in (&#39;acc_payment&#39;,&#39;acc_payment_create&#39;)<br>UNION ALL<br>-- close_to<br>SELECT close_to_addr_id addr_id, round, 0, 0, 1<br>  FROM mainnet.txn where type_ext in (&#39;acc_close&#39;)<br>) SELECT <br>    addr_id                        -- address id<br>    , min(round) r1                -- first round<br>    , max(round) r2                -- last round<br>    , sum(outflow) outflows        -- number of outflows TX<br>    , sum(inflow) inflows          -- number of inflows TX<br>    , sum(closeto) closeto         -- number of close to TX<br>  FROM tx <br>  GROUP BY addr_id <br>  HAVING <br>    r2 - r1 &gt; 10000000             -- spanning &gt;10M round<br>    AND outflows &gt; 1000000         -- at least 1M outflows<br>    AND inflows &gt; 1000000          -- at least 1M inflows<br>    AND closeto &gt; 1                -- at least 1 closeto<br>  ORDER BY count() DESC limit 1</pre><p>This will pick the top account by the number of transactions that has at least 1M inbound and 1M outbound payment transactions spanning at least 10M rounds.</p><p>Note that Allo DW transaction type annotation differentiates between a payment transaction (‘acc_payment’) to an account that already existed and ‘acc_payment_create’ transaction that initially funded an account.</p><p>Allo DW schema stores accounts as UInt64 IDs with a separate map between IDs and full Algorand 58 character address encoding. <br>The one chosen is AACCDJ…LTEN4A with ID: 1740798472</p><h3>Getting Algo balance history for an account</h3><p>To calculate daily Algo holdings for an account we construct a union query that aggregates all daily deltas from rewards, inflows, outflows and calculate a running sum over the output.</p><p>Note that we calculate using Int128 to prevent overflow while keeping full precision in micro Algos. The result is finally shifted by 6 decimals to arrive at the Algo value.</p><pre>with inoutalgoagg as (<br>   with deltas as (<br><br>    -- Add all sender rewards<br>    select toDate(realtime) ts, sum(rs::Int128) dAlgo <br>    from mainnet.txn_rewards <br>    where sid = 1740798472 and rs &gt; 0 group by ts<br><br>    union all <br><br>    -- Add all receiver rewards<br>    select toDate(realtime) ts, sum(rr::Int128) dAlgo <br>    from mainnet.txn_rewards  <br>    where rid = 1740798472 and rr &gt; 0 group by ts<br><br>    union all <br><br>  -- Add all close_to rewards<br>    select toDate(realtime) ts, sum(rc::Int128) dAlgo <br>    from mainnet.txn_rewards  <br>    where cid = 1740798472 and rc &gt; 0 group by ts<br><br>    union all<br><br>    -- All fees :: outflows (minus)<br>    select toDate(realtime) ts, -sum(fee::Int128) dAlgo from mainnet.txn <br>    where snd_addr_id = 1740798472 and fee &gt; 0 group by ts<br><br>    -- PAYments from the account :: outflows (minus)<br>    -- lets not forget about the outflow in case of account close<br>    union all <br>    select toDate(realtime) ts, -sum(amount::Int128 + close_amount::Int128) dAlgo <br>    from mainnet.txn <br>    where snd_addr_id = 1740798472 and typeenum = 1 group by ts<br><br>    -- PAYments to the account :: inflows (in plus)<br>    union all <br>    select toDate(realtime) ts, sum(amount::Int128 ) dAlgo from mainnet.txn <br>    where rcv_addr_id = 1740798472 and typeenum = 1 group by ts<br><br>    -- PAYmets to the account that are part of close :: inflows (in plus)<br>    union all <br>    select toDate(realtime) ts, sum(close_amount::Int128) dAlgo from mainnet.txn <br>    where close_to_addr_id = 1740798472 and typeenum = 1 group by ts <br><br>   ) select ts, sum(dAlgo) da, sumState(dAlgo) ra from deltas group by ts order by ts  <br>) select ts, da, runningAccumulate(ra)/1000000 balance from inoutalgoagg <br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*jpPu8ILZdPaj2sTP7mGq-Q.png" /></figure><p>This method ignores the initial balance of genesis accounts. One needs to add genesis data stored separately in Allo DW to get the correct results for this particular set of accounts.</p><h3>Finding an interesting account … take 2</h3><p>This time let’s find an account with the highest daily delta variance and over a minimum of 100-day time span.</p><pre>WITH deltas AS<br>    (<br>        SELECT<br>            snd_addr_id AS addr,<br>            toDate(realtime) AS ts,<br>            -sum(CAST(amount, &#39;Int128&#39;) + CAST(close_amount, &#39;Int128&#39;)) AS dAlgo<br>        FROM mainnet.txn<br>        WHERE typeenum = 1<br>        GROUP BY<br>            1,<br>            ts<br>        UNION ALL<br>        SELECT<br>            rcv_addr_id,<br>            toDate(realtime) AS ts,<br>            sum(CAST(amount, &#39;Int128&#39;)) AS dAlgo<br>        FROM mainnet.txn<br>        WHERE typeenum = 1<br>        GROUP BY<br>            1,<br>            ts<br>    )<br>SELECT<br>    addr,<br>    varPop(intDiv(dAlgo,10000000)) AS varPop<br>FROM deltas<br>GROUP BY addr<br>HAVING count() &gt; 100<br>ORDER BY 2 DESC<br>LIMIT 5</pre><p>Crunching quick daily balance deltas across 1.1 billion transactions takes less than 10 seconds with the following results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*-oyLdz_qq8YWPlFW43EEjA.png" /></figure><p>Let’s graph the balance of V3ZJHY…3P5IIA :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*lPyxBa2c9oVS44iIGyw1nA.png" /></figure><h3>Take 3</h3><p>This time let’s find the most popular account where the popularity metric is going to be defined as a product of unique inflow addresses and unique outflow addresses.</p><pre>WITH unique_senders_receivers as (<br>  SELECT <br>    snd_addr_id addr_id<br>    , uniq(rcv_addr_id) ur<br>    , 0 us <br>  FROM mainnet.txn WHERE typeenum = 1 GROUP BY 1 HAVING ur &gt; 1000<br>UNION ALL<br>  SELECT <br>    rcv_addr_id addr_id<br>    , 0 ur<br>    , uniq(snd_addr_id) us <br>  FROM mainnet.txn WHERE typeenum = 1 GROUP BY 1 having us &gt; 1000<br>) SELECT addr_id, sum(us)*sum(ur) popularity <br>  FROM unique_senders_receivers GROUP BY 1 ORDER BY 2 DESC limit 5 </pre><p>The popularity contest winner is … BINANCE with account id 3907164 <br>address SP745J…MDCZVM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*pp9o-3yK16SQhb12MOZv4Q.png" /></figure><p>The same principle can be applied to calculate ASA token or online stake distribution at specific block but we’ll explore this idea in another article.</p><p>A single pass (no unions) query is possible using ClickHouse dynamic arrays but would be harder to deconstruct in the article. Also the union version already executes in under 15 seconds over all accounts across over a billion of transactions.</p><p><em>All examples use commercial Allo.info Algorand Self Service BI offering. <br>Please contact sales@allo.info for a custom quote.</em></p><p>🔬<em>Note that researchers get free access to the platform. </em>🔬</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dea1dbd88dc5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nodely/calculating-the-balance-on-algorand-dea1dbd88dc5">Calculating balances on Algorand</a> was originally published in <a href="https://medium.com/nodely">Nodely</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>