Skip to content

Instantly share code, notes, and snippets.

View RobinLinus's full-sized avatar
🧡
₿itcoin

Robin Linus RobinLinus

🧡
₿itcoin
View GitHub Profile

Decaying MultiSig using nLockTime

A decaying MultiSig that requires no bitcoin script other than regular MultiSigs.

A 3-of-3 that decays into a 2-of-3 at block height x.

  1. Alice, Bob, and Carol create a 3-of-3 regular MultiSig output.

  2. Alice signs the output with nLocktime = x and SIGHASH_NONE.

  3. She sends this partially signed TX to Bob and Carol.

@RobinLinus
RobinLinus / sig_pow.md
Last active April 25, 2024 16:36
Timelocked Proof of Work via signature length

The following script allows everyone to spend; the shorter your signature the earlier you can spend.

OP_SIZE
OP_CHECKSEQUENCEVERIFY OP_DROP

OP_CHECKSIGVERIFY

The point R = 1/2 G has the smallest known x coordinate -- x = 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63. If the public key is chosen P = 1 G then the ECDSA signature becomes s=2(H(m)+x). So, the smaller H(m) the smaller s (as long as it is bigger than x ~ 2^165). Thus, the above output is spendable by the miner mining the lowest TX hash.

@RobinLinus
RobinLinus / is-fritzbox.js
Created December 1, 2019 21:31
Detect if the client's router is a FritzBox
function isFritzBox(){
return new Promise(resolve =>{
let img = document.createElement('img');
img.onload = _ => resolve(true);
img.onerror = _ => resolve(false);
img.src = 'http://fritz.box/favicon.ico';
});
}