Skip to content

Instantly share code, notes, and snippets.

Avatar

Marek marekyggdrasil

View GitHub Profile
@marekyggdrasil
marekyggdrasil / README.md
Last active Jun 23, 2022
A proposal for ツ GRIN tipping Telegram bot
View README.md

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 Feb 21, 2022
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....
View output.md

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 Jan 17, 2022
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
View README.md

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 / figures_thumbnail.sh
Last active Sep 14, 2021
Example code for the tutorial on Pedersen Commitments and Confidential Transactions available under https://mareknarozniak.com/2021/06/22/ct/
View figures_thumbnail.sh
#!/bin/sh
convert -background none inputs_before.png inputs_after.png +append inputs.png
@marekyggdrasil
marekyggdrasil / figures_thumbnail.sh
Last active Sep 13, 2021
Source code and results for the Schnorr signature tutorial available under https://mareknarozniak.com/2021/05/25/schnorr-signature/
View figures_thumbnail.sh
#!/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 / aes.py
Last active Apr 24, 2021
Examples for tutorial on symmetric ciphers available under https://mareknarozniak.com/2021/04/22/symmetric/
View aes.py
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 / ecdsa_knowledge.png
Last active Sep 12, 2021
Tutorial covering the Eliptic Curve Digital Signature Algorithm (ECDSA) available under https://mareknarozniak.com/2021/03/16/ecdsa/
@marekyggdrasil
marekyggdrasil / distrib.png
Last active Jan 27, 2021
A source code for a probability plots for a trustless Mimblewimble transaction aggregator based on scalable BFT https://mareknarozniak.com/2021/01/27/aggrematon/
@marekyggdrasil
marekyggdrasil / plotting.py
Last active May 8, 2021
Tutorial covering the concept of geometric phase for a qubit, tutorial available under https://mareknarozniak.com/2021/01/09/qubit-berry-phase/
View plotting.py
import matplotlib.pyplot as plt
def plotQubit(angles, refrel, refimag, resrel, resimag, title, x_axis, filename, url=''):
fig, ax = plt.subplots(1, 1, constrained_layout=True)
ax.set_title(title)
x_axis += '\n' + url
ax.set_xlabel(x_axis)
ax.set_ylabel('phase')
@marekyggdrasil
marekyggdrasil / index.js
Last active Dec 10, 2020
node.js example on how to connect to the grin-wallet owner API based on: it is a modified official example from here: https://github.com/mimblewimble/grin-wallet/tree/1ced8990b9e21fa17c788d93a151ec1164ebbce5/doc/samples/v3_api_node
View index.js
/* Sample Code for connecting to the V3 Secure API via Node
*
* With thanks to xiaojay of Niffler Wallet:
* https://github.com/grinfans/Niffler/blob/gw3/src/shared/walletv3.js
*
*/
const http = require('http');
const crypto = require('crypto');