Skip to content

Instantly share code, notes, and snippets.

View gcomte's full-sized avatar
⌨️
coding

Gabriel Comte gcomte

⌨️
coding
View GitHub Profile
@gcomte
gcomte / gist:dba89cb2d993e211a8e15a8cf0f200d2
Last active July 10, 2023 20:09
[CUBO+] Fix nigiri & docker permissions
# Fix docker and permission issues for nigiri
1) Make sure docker can be run without 'sudo' (make sure your user has the required permissions): https://docs.docker.com/engine/install/linux-postinstall/
2) Make sure nigiri can be run without sudo:
sudo chown $USER:$USER $(which nigiri)
--> involves restarting linux (or logging out and logging in again)
3) Make sure nigiri is stopped:
sudo nigiri stop --delete; nigiri stop --delete
@gcomte
gcomte / gist:9e4b8bf2edb82e17af8913cba0c46aa2
Last active July 10, 2023 16:51
CUBO+ Workshop Testnets and LSPs
### Install nigiri
Quick: https://nigiri.vulpem.com/#install
Safer: https://github.com/vulpemventures/nigiri/releases
`nigiri start --ln`
### Play with nigiri
Usage: https://github.com/vulpemventures/nigiri#start-nigiri
Check out esplora:
### How to create a Lightning Address for your own domain using Wallet of Satoshi
1) Think of the lightning address you want to have. It will be <your-user>@<your-domain>.
2) Install Wallet of Satoshi on your phone: https://www.walletofsatoshi.com/
3) Lookup your <wos-address>: Tap "Receive", switch to the tab called "Lightning Address". Your <wos-address> is something@walletofsatoshi.com .
4) We're particularly interested in the first part of your <wos-address>, the part before the @-sign. We're gonna call that part <wos-user>.
5) Open https://walletofsatoshi.com/.well-known/lnurlp/<wos-user> in your browser. Safe that website. Give the file the name <your-user> . No file ending.
6) Move that file onto your webserver, into a newly created directory structure: .well-known/lnurlp/
7) If you did everything right, you can now see the file when you open <your-domain>/.well-known/lnurlp/<your-user> in your browser.
8) Your new lightning address works! Open another Lightning wallet (not your Wallet of Satoshi) and

This doc is about finding a collision in a 128-bit hashing-scheme.

Collision attack vs. sheer luck

One has to consider, whether we are dealing with an attacker that seeks to find collisions, or whether we have regular users that could just come up with a same UUID v5 by accident.

For the attacker scenario, given that SHA-1 is being used for UUID v5 and SHA-1 is cryptographically broken,

#!/bin/bash
CHANNEL_SIZE=10000000
ONCHAIN_FEES=1
SERVER="$(cut -d'@' -f2 <<< $1)"
PUBKEY="$(cut -d'@' -f1 <<< $1)"
OPENCHANNEL_COMMAND="lncli --network testnet openchannel --connect $SERVER --sat_per_byte ${ONCHAIN_FEES} --remote_csv_delay 100 ${PUBKEY} ${CHANNEL_SIZE} 0"
fn main(){
let name = String::from("Alice");
say_hello(&name);
// shadowing variable in child scope
{
let name = String::from("Bob");
println!("Temporarily shadowed name: {}", name);
say_hello(&name);
/* ===========================CREDITS=========================== */
/* Custom BTCpay Server CSS template made by @artdesignbySF. */
/* PLEASE CONSIDER DONATING BITCOIN IF YOU FIND */
@gcomte
gcomte / btccalc.sh
Last active July 21, 2022 19:08
converts between SAT, BTC, USD, EUR, CHF
#!/bin/zsh
API_KEY=<<<ENTER YOUR BITCOINAVERAGE.COM API KEY HERE>>>
BTC_DENOMINATION='BTC'
USD_DENOMINATION='USD'
EUR_DENOMINATION='EUR'
CHF_DENOMINATION='CHF'
echo "Enter amount [ SAT | BTC | USD | EUR | CHF ] :"
@gcomte
gcomte / gist:013212cc5c2e3662f63ffce5c81829b0
Last active October 2, 2019 13:41
LND: lookup old inactive channels
#!/bin/bash
TIME_GAP=$((60 * 60 * 24 * 30 * 2)) # 2 months
NOW=$(date +%s)
CONSIDERED_OLD=$((NOW - TIME_GAP))
PUBKEY_OF_THIS_NODE=$(lncli getinfo | jq -r '.identity_pubkey')
TABLE_HAS_ENTRIES=false