Skip to content

Instantly share code, notes, and snippets.

@marekyggdrasil
marekyggdrasil / README.md
Last active June 23, 2022 16:19
A proposal for ツ GRIN tipping Telegram bot

GRIN Tipping Bot Bounty Proposal

by renzokuken

Introduction

This document aims to technically define the requirements for a Telegram bot that can deposit and withdraw GRIN digital cash cryptocurrency. It is meant to be regarded as a formal application for a bounty suggested in this forum post.

Use cases

Such a bot could serve more than one purpose.

@marekyggdrasil
marekyggdrasil / output.md
Last active February 21, 2022 14:42
I found this problem with serialization / deserialization of objects of type CircuitValue in snarky-js when arrayProp is involved, not sure if it is correct or not....

Running the version without arrayProp

[nodemon] starting `node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm try_circuit_serialization.ts`

* checking if JSONized objects match after parsing

{ a: '1', b: { value: '1' } }
{ a: '1', b: { value: '1' } }
@marekyggdrasil
marekyggdrasil / README.md
Last active January 17, 2022 04:21
weird MINA issue with keypair generation, attempting to develop a test for preimage proof https://github.com/o1-labs/snarkyjs-examples/blob/master/src/ex00_preimage.ts

Runs and passes, but if I uncomment line 27 it fails with

 console.log
    oo

      at Object.mM [as caml_pasta_fp_plonk_index_create] (node_modules/snarkyjs/dist/server/node_bindings/snarky_js_node.bc.js:2:23985)

  console.log
 eyo
@marekyggdrasil
marekyggdrasil / ecc.py
Last active November 16, 2021 12:39
Tutorial covering the concept of Elliptic Curve Cryptography and Diffie-Hellman Key Exchange, tutorial available under https://mareknarozniak.com/2020/11/30/ecdh/
import numpy as np
# ECC addition in R
def eccContAddition(Px, Py, Qx, Qy, a, b):
if np.isclose([Px], [Qx])[0]:
m = (3.*Px**2.+a)/(2.*Py)
else:
m = (Py-Qy)/(Px-Qx)
Rx = m**2 - Px - Qx
@marekyggdrasil
marekyggdrasil / figures_thumbnail.sh
Last active September 13, 2021 09:52
Source code and results for the Schnorr signature tutorial available under https://mareknarozniak.com/2021/05/25/schnorr-signature/
#!/bin/sh
convert -background none multisignature_alice.png multisignature_bob.png multisignature_composite.png +append multisignature_keys.png
convert -background none multisignature_nonces.png multisignature_lhs_signatures.png multisignature_rhs_signatures.png +append multisignature_verification.png
@marekyggdrasil
marekyggdrasil / ecdsa_knowledge.png
Last active September 12, 2021 14:53
Tutorial covering the Eliptic Curve Digital Signature Algorithm (ECDSA) available under https://mareknarozniak.com/2021/03/16/ecdsa/
ecdsa_knowledge.png
@marekyggdrasil
marekyggdrasil / outcomes.png
Last active July 9, 2021 06:00
A brief tutorial how to simulate quantum teleportation with QuTip quantum computing library in Python. More detailed explanation available here: http://mareknarozniak.com/2020/03/22/simulating-quantum-teleportation/
outcomes.png
@marekyggdrasil
marekyggdrasil / run_rtsp_raw.py
Created May 28, 2020 12:42
An example of a raw livestream pipeline generated from numpy array, based on https://github.com/jackersson/gstreamer-python/commit/98424f8c21bd84805313d8890d789e739d115ffa and to put it in context, I made this example for this issue https://github.com/jackersson/gst-python-tutorials/issues/4
#!/usr/bin/env python
# -*- coding:utf-8 vi:ts=4:noexpandtab
# Simple RTSP server. Run as-is or with a command-line to replace the default pipeline
import time
import sys
import abc
import numpy as np
import typing as typ
from fractions import Fraction
@marekyggdrasil
marekyggdrasil / aes.py
Last active April 24, 2021 10:36
Examples for tutorial on symmetric ciphers available under https://mareknarozniak.com/2021/04/22/symmetric/
from Crypto.Cipher import AES
from getpass import getpass
ciphertext = None
with open('ciphertext3.txt', 'r') as file:
ciphertext = bytes.fromhex(file.read())
password = getpass('Password: ')
key = bytes(password, 'ascii')
key = key + b'\x00'*(16-len(key))
@marekyggdrasil
marekyggdrasil / distrib.png
Last active January 27, 2021 13:21
A source code for a probability plots for a trustless Mimblewimble transaction aggregator based on scalable BFT https://mareknarozniak.com/2021/01/27/aggrematon/
distrib.png