Skip to content

Instantly share code, notes, and snippets.

@oriolpont
oriolpont / blesko.js
Created June 15, 2021 20:57
Generate Bleskomat lnurl-withdraw codes
// Copyright (C) 2021 Bleskomatizer, (C) 2017 Pieter Wuille (for the Bech32 subprocedures below)
// SPDX-License-Identifier: MIT
/*
The Bleskomat https://github.com/samotari/bleskomat-diy is an LNURL-based ATM which uses offline, low power, inexpensive hardware.
It basically counts coins and then displays a corresponding lnurl-withdraw QR. Then, the server (bleskomat-server or lnbits), paired
with an LN node, authenticates the HMAC code, calculates the exchange rate, and calls back the payer to retrieve and pay their LN invoice.
This NodeJS script generates lnurl-withdraw codes in the same way, as a "manual Bleskomat" of sorts, or for testing.
Adjust baseUrl, id, secret, and f (fiat currency) to match those of your server, then run it as: node blesko.js [amount]
*/
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I claim that the tthe three identities orpo.id, oriolpont.id and opont.id, are all blockstack identities of mine, associated to the github account oriolpont, and associated to the oriolpont@gmail.com address
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBCgAGBQJc8W9FAAoJEIQkw7rwwtiAcpoIAIbM0p5iCPxdOF1mZhR50P9a
//apjUVWJarWUIzlwpgk8NwpJ1ybyQvB9/OLO8ATYplZOprl9JF5PiBPoiJifJwl
2GfnrDK3F4VojMjpBcEHPt8H90ao5szbPFufl2LAqMoZJNMBCVydHwv7qkH1uYAX
@oriolpont
oriolpont / gist:b5347229f7341e83dd071c7f5cfe4715
Created November 10, 2017 13:57
Verifying my Blockstack ID is secured with the address 12zfc8EHeQES2nmX63yznnQ8y9FnuD6LE2 https://explorer.blockstack.org/address/12zfc8EHeQES2nmX63yznnQ8y9FnuD6LE2
Verifying my Blockstack ID is secured with the address 12zfc8EHeQES2nmX63yznnQ8y9FnuD6LE2 https://explorer.blockstack.org/address/12zfc8EHeQES2nmX63yznnQ8y9FnuD6LE2
@oriolpont
oriolpont / gist:abbe9683c90a1d716e5ea018b8a7ef19
Created November 10, 2017 13:54
Verifying my Blockstack ID is secured with the address 1CMVfgooyoqp2LVHxQHJ185fUskhTshnqH https://explorer.blockstack.org/address/1CMVfgooyoqp2LVHxQHJ185fUskhTshnqH
Verifying my Blockstack ID is secured with the address 1CMVfgooyoqp2LVHxQHJ185fUskhTshnqH https://explorer.blockstack.org/address/1CMVfgooyoqp2LVHxQHJ185fUskhTshnqH
@oriolpont
oriolpont / gist:1a731a12bf3e973e1490a0dc1e80a171
Created November 7, 2017 17:07
Verifying my Blockstack ID is secured with the address 13H5s9G7xnvHdKANAFUcCwFMj3axJ64CGU https://explorer.blockstack.org/address/13H5s9G7xnvHdKANAFUcCwFMj3axJ64CGU
Verifying my Blockstack ID is secured with the address 13H5s9G7xnvHdKANAFUcCwFMj3axJ64CGU https://explorer.blockstack.org/address/13H5s9G7xnvHdKANAFUcCwFMj3axJ64CGU
### Keybase proof
I hereby claim:
* I am oriolpont on github.
* I am pont (https://keybase.io/pont) on keybase.
* I have a public key whose fingerprint is D9EC 4D54 A644 99E0 DBCC 2F4C 8424 C3BA F0C2 D880
To claim this, I am signing this object:
@oriolpont
oriolpont / Makefile
Last active August 29, 2015 14:17 — forked from codedot/Makefile
RIPPLE_LIB = node_modules/ripple-lib/package.json
all: hedge.js $(RIPPLE_LIB)
node hedge | tee latest.log | tee -a full.log
if grep -q "Offers submitted" latest.log; then \
$(MAKE) email; \
$(MAKE) trips; \
fi
$(RIPPLE_LIB):
@oriolpont
oriolpont / Makefile
Last active August 29, 2015 14:17 — forked from codedot/Makefile
HEDGE = node bithedge
all:
npm install bitstamp
hedge:
$(HEDGE) old >|old.txt
cat old.txt
$(HEDGE) cancel `cat old.txt`
$(HEDGE) balance >|balance.txt
#!/bin/bash
# This script reads text from stdin, generates its QR code and splits it into two visual cryptographic images. Both images appear random and have as many whites as blacks. Only when print on transparent film (or extremely thin paper) and superposed, the ciphered QR code appears as gray/black dots.
# We use the program "qrencode" to generate a QR code. We create then a random array and we visual-XOR it (see below) with the QR code to retrieve the ciphered code. Only the random array (nonce or one-time pad) and the ciphered array are recorded, and only when both are superposed they reveal the QR code. Notice that the one-time pad and the ciphered array are statistically equivalent and correlationally symmetric, so we can properly define them as a 2-of-2 secret sharing scheme.
# The visual-cryptographic scheme used was originally inspired of http://leemon.com/crypto/VisualCrypto.html . It corresponds to probably the simplest case of the formalism introduced in Naor & Shamir "Visual Cryptography" LNC