Skip to content

Instantly share code, notes, and snippets.

View emg110's full-sized avatar
🌍
BUIDLING | HODLING

MG emg110

🌍
BUIDLING | HODLING
View GitHub Profile

download - 2024-10-11T114753 863

Understanding ARC-71 PR

SoulBound Tokens on Algorand

The rise of SoulBound Tokens (SBTs) has introduced a fascinating concept where tokens, representing identities, credentials, or other personal attributes, are permanently bound to a user's account (cryptographic identity).

Algorand's ARC-71 proposal PR for SoulBound Algorand Standard Assets (SBT ASAs) takes this idea further, offering a thoughtful implementation of SBTs while maintaining key principles of decentralization, user sovereignty, and flexibility. In this article, we will explore how ARC-71 delivers on the promise of SBTs while respecting unique features of Algorand like the ability for users to close out a token to the creator, even if the token is frozen, without violating the SBT core properties of non-transferability, non-sellability, permanency, and non-burnability.

@emg110
emg110 / Algorand_Facs.md
Last active November 9, 2023 18:05
Algorand_Facts.md

Quick Overview of Algorand

Overview

  • Launch: L1 blockchain launched in 2019 by Silvio Micali, a father of modern cryptography and co-inventor of zero-knowledge proofs (ZKPs).
  • Transactions: 1,000 TPS (Type of Transactions), 10,000 TPS on testnet.
  • Performance: Pure Proof-of-Stake (PPoS), instant transaction (no failed tx's), block finality ~4.5 sec.
  • Cost: Nominal ALGO fee per transaction (~$0.001).
  • Reliability: No forks, no block reorganizations, no rollbacks.
  • Architecture: Permissionless, scalable, decentralized (+1k Nodes).
@emg110
emg110 / Como_cunhar_um_PLAUS.md
Created November 7, 2023 07:51
Como cunhar um PLAUS?

Como cunhar um PLAUS?

PLAUS é um item de prova para um evento, interação ou informação do mundo real, que é encapsulado em um contrato inteligente com um NFT e entregue através de um magiclink!

PLAUSIBLE é o protocolo PLAUS construído e fornecido pela GoPlausible, um projeto do ecossistema Algorand, para fornecer cenários de prova dinâmicos e ilimitados como itens PLAUS!

Cada item PLAUS pertence ao seu criador e opera de forma permissionless, confiável e descentralizada, consistindo em um contrato inteligente, itens NFT gerados por esse contrato e um sistema de entrega baseado em magiclinks!

Os magiclinks são criptograficamente verificáveis quanto à autenticidade da GoPlausible, pois todos são assinados pela conta GoPlausible.algo e podem ser verificados por qualquer cliente que os receba!

Solution to opcode budget increase

Ingredients:

  • A dummy method on smart contract
  • A TXN to call that ABI dummy method
  • On client implementation, Adding that TXN to the TXN group in need of more opcode budget (each budget TXN adds 700 budget)

The dummy method

@emg110
emg110 / INNER_TXN_ID_ISSUE_CASE.md
Last active October 25, 2023 12:29
This Gist contains all snippets and content regarding INNER-TXN ID ISSUE CASE

INNER-TXN ID ISSUE CASE

The construct map

CONCAT_ARRAYS(Byte array from "TX" (protocol.Transaction), Parent Tx id byte array, index of inner-txn in big endian byte array, inner-txn msgpack encoded body byte array)

Sequence of Byte Arrays in Txid Byte array from "TX" (protocol.Transaction): The function starts by getting a buffer from getTxEncodingBuf(), which already contains the protocol.Transaction bytes.this is the first part of the sequence.

Parent Tx id byte array: The function then appends the parent transaction ID (parent[:]) to the buffer. This becomes the second part of the sequence.

@emg110
emg110 / wellknown_mail_services.md
Last active August 13, 2023 15:20
GoPlauisble Wellknown email domains

GoPlauisble Wellknown email domains:

  1. Gmail: gmail.com
  2. Yahoo: yahoo.com
  3. Microsoft Outlook: outlook.com, hotmail.com, live.com
  4. Apple iCloud: icloud.com, me.com
  5. AOL: aol.com
  6. Zoho Mail: zoho.com
  7. ProtonMail: protonmail.com
  8. Yandex: yandex.com
  9. Mail.com: mail.com
@emg110
emg110 / royalty-fees-on-algorand.md
Last active January 24, 2022 14:02
@emg110 review on "Royalty Fees on Algorand gist" by @rssalessio

Royalty Fees on Algorand

This is a short tutorial that explains how to implement Royalty Fees for Algorand NFTs using Teal v5 and new features like Inner Transactions.

It's assumed that readers have sufficient programming knowledge, general familiarity with blockchain technology and Algorand terminology. Smart contracts are written in PyTeal, and examples in Typescript.

To get codes used during this tutorial, please refer to GitHub repository!

Requirements

const fs = require('fs');
const logger = require('./logger');//JUST PICKUP A LOGGER LIKE THIS LOGGER HERE: https://gist.github.com/emg110/1ab0584ff59b6f216304ec68b0977f7c
const { Client } = require('@elastic/elasticsearch');
const client = new Client({ node: 'http://YOUR_ES_SERVER:ES_HTTP/S_PORT' });
const inStream = fs.createReadStream('././data/YOUR_NEDB_FILE.db');
var lineReader = require('readline').createInterface({
input: inStream
});
async function writeToES(doc){
await client.index({
@emg110
emg110 / winston_3_customization_by_chalk.js
Last active April 26, 2022 08:41
Winston 3 customization by chalk
const { createLogger, format, transports } = require('winston');
const chalk = require('chalk');
const { combine, timestamp, label, printf, simple, splat } = format;
const consoleFormat = printf(({ level, message, label, timestamp }) => {
var levelUpper = level.toUpperCase();
switch (levelUpper) {
case "INFO":
message = chalk.green(message);
level = chalk.black.bgGreenBright.bold(level);
break;