Skip to content

Instantly share code, notes, and snippets.

View LLFourn's full-sized avatar

Lloyd Fournier LLFourn

View GitHub Profile
@LLFourn
LLFourn / review-of-practical-schnorr-threshold.md
Last active October 25, 2023 09:32
Review of Practical Schnorr Threshold Signatures Without the Algebraic Group Model

My review of Practical Schnorr Threshold Signatures Without the Algebraic Group Model

Inline comments

Page 4

However, this is non-trival because we need to consider the PedPoP DKG and the signing protocol together. The rationale behind this is that PedPoP (like Pedersen DKG) lacks the ability to be simulated. Hence, it becomes crucial to examine the combination of the DKG and the signing

@LLFourn
LLFourn / unifing-frost-and-musig.md
Last active March 28, 2023 02:30
Unifing FROST and MuSig

Unifing FROST and MuSig

There might be a secure scheme that non-interactively generates a n-of-n FROST key and from there you can interactively turn it into a t-of-n by issuing new shares (i.e. enrolment). I don't really know if this is a useful contribution even if it works. There might be some utility in not having multiple schemes but rather a one size fits all approach.

Idea

MuSig takes a "multiset" of n public keys and outputs a single aggregated key which takes n-of-n secret keys to sign. Set z_i = H(X_1,.. X_i, .. X_n, X_i) for i = 1,2, .. n.

OP_CTV and DLCs

Hi dlc-dev and bitcoin-dev,

tl;dr OP_CTV simplifies and improves performance of DLCs by a factor of a lot.

Introduction

Dryja introduced the idea of Discreet Log Contracts (DLC) in his breakthrough work[1]. Since then (DLC) has become an umbrella term for Bitcoin protocols that map oracle secret revelation to an on-chain transaction which apportions coins accordingly.

ª 0xAA
µ 0xB5
º 0xBA
À 0x41
Á 0x41
 0x41
à 0x41
Ä 0x41
Å 0x41
Æ 0xC6
sub MAIN(Int \m, Int \n, Int :$samples = 10_000) {
my \q = 2 ** 19 - 1;
my \m-n = m ** n;
# experiment should be done over a prime field so that it mirrors reality
say "q = {q} (is-prime: {q.is-prime})";
say "samples = {$samples}, m = {m}, n = {n}, m ^ n = {m-n}";
sub count-collisions(@table) {
# This line of code:
@LLFourn
LLFourn / anticipate_signature.rs
Last active March 15, 2021 18:31
rust code for anticipating signatures for Discreet Log Contract oracles with the standard rust-secp256k1 library
//! PoC style code for anticipating BIP-340 style signatures for PoC DLC stuff.
//!
//! WARNING this doesn't check that:
//! 1. Public keys have an even Y coordinate
//! 2. Public nonces have a square Y coordinate
//!
//! If the public keys are in the right form, then this should produce valid
//! BIP-340 signatures (to be fully compatible then the tag needs to be set
//! correctly).
//! Add to Cargo.toml:
@LLFourn
LLFourn / fair_atomic_swaps_response.md
Last active January 5, 2019 07:07
Re: [Lightning-dev] An Argument For Single-Asset Lightning Network

This is a response I made to the thread that didn't make it into the archive (I think) :https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-December/001752.html


Happy new year lightning-dev!

This topic is my main area of research at moment so I'm really happy to see a thread about it. In general I agree with ZmnSCPxj's analysis and conclusions. I'd like to add a couple of ideas to this discussion and would greatly appreciate some early peer review on them :)

HTLCs as American call options

@LLFourn
LLFourn / Rakudo.sp
Created November 29, 2017 00:50
in dev Spit module for building rakudo docker images
class Rakudo {
constant File $:install-to;
constant $:checkout = '2017.07';
constant File $:clone-to = './rakudo';
constant GitHub $:zef-repo = 'ugexe/zef';
constant GitHub $:repo = 'rakudo/rakudo';
constant Bool $:debug-moar;
static method install-deps on {
@LLFourn
LLFourn / docker_PID1.sh
Last active August 10, 2023 13:37
Docker, Getting around PID 1
# So you want to pipe shell scripts to docker. But docker runs the container's command as PID 1.
# Linux doesn't set up signal handlers for PID 1.
# This gives you the following problems:
# 1. The script can't kill itself:
echo 'kill $$; echo "Still alive"' | docker run -i --rm alpine sh
# 2. You can't kill the script from outside with a normal kill:
echo "sleep 1000" | docker run -i --rm alpine sh & sleep 1 && kill $!
docker ps # it didn't die
#==== Solving problem 1 ====
BEFORE:
A 9.0422700
C 10.6984718
B 10.3635278
a 17.9581401
b 21.61539652
c 27.7105599
HEAD:
A 4.126187
C 4.918153