Skip to content

Instantly share code, notes, and snippets.

View TanjinAlam's full-sized avatar

Md Tanjin Alam TanjinAlam

View GitHub Profile
@TanjinAlam
TanjinAlam / docker-compose.yml
Created February 17, 2024 10:30 — forked from ftmoose/docker-compose.yml
MongoDB ReplicaSet Docker Configuration
version: "3.1"
# Our containers
services:
# Temporary container used to initialize the replica set
mongo-setup:
container_name: mongo-setup
image: mongo
restart: on-failure
networks:
@TanjinAlam
TanjinAlam / ibftConfigFile.json
Last active May 31, 2023 12:00
ibftConfigFile.json
{
"genesis": {
"config": {
"chainId": 14333,
"berlinBlock": 0,
"ibft2": {
"blockperiodseconds": 2,
"epochlength": 30000,
"requesttimeoutseconds": 4
}
@TanjinAlam
TanjinAlam / zkp-factor-factor-9.txt
Last active April 19, 2023 19:05
zkp-factor of 9
pragma circom 2.0.0;
include "/usr/local/lib/node_modules/circomlib/circuits/comparators.circom";
template FactorCircuit() {
signal input a;
signal output isFactor;
// Constraint to ensure that a are factors of 9
signal temp;
@TanjinAlam
TanjinAlam / cbdc
Created January 19, 2023 10:25
pubkey
CONTRACT_ADDRESS_BDTOKEN=0x389cACE1478ad58245c04BE6ae47b9EdC7881515
Validator1_pubkey=0x8F1f90DCf24b532e3580998E78fdc5224f94307E
Validator1_privkey="12c97ce3557d01b69b4a7398a2ae8fa0b52181392fa52b8ba90905c2f1336234"
SIGNER=0xf2F4E1205B7Ac806847D7F50FbFed8469656688B
PKEY="c506cbbc39ff6ceb48c9d42d46026f2fb87a596232f7cf90c240478dbc14fd31"
#!python3
import hashlib
import math
import sys
from base64 import b64decode, b64encode
prooffile = "proof.txt" # File where Merkle proof will be written.
MAXHEIGHT = 20 # Max height of Merkle tree
@TanjinAlam
TanjinAlam / bitcoin-merkle-proofs.js
Created December 24, 2022 09:00 — forked from eddmann/bitcoin-merkle-proofs.js
Bitcoin Internals: Verifying Merkle Roots using Merkle Proofs in JavaScript
const fetchLatestBlock = () =>
fetch(`https://blockchain.info/q/latesthash?cors=true`)
.then(r => r.text());
const fetchMerkleRootAndTransactions = block =>
fetch(`https://blockchain.info/rawblock/${block}?cors=true`)
.then(r => r.json())
.then(d => [d.mrkl_root, d.tx.map(t => t.hash)]);
const random = arr =>
mkdir node1 node2
geth account new --datadir ./node1
geth account new --datadir ./node2
puppeth
export mytestnet.json
geth init --datadir "./node1" mytestnet.json
# Copyright 2018-2020 Cargill Incorporated
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
from pyteal import *
from pyteal.ast.bytes import Bytes
from pyteal_helpers import program
def approval():
# local variable for each users
# global_owner = Bytes("owner") # byteslice
# local_owner = Bytes("owner") # byteslice
# local_balance = Bytes("balance") # uint64
// const algosdk = require('algosdk')
// const dotenv = require("dotenv");
// const fs = require("fs");
const algosdk = require("algosdk");
// dotenv.config();
//SMART CONTRACT DEPLOYMENT
// declare application state storage (immutable)
const localInts = 0;