Skip to content

Instantly share code, notes, and snippets.

Janus Troelsen ysangkok

Block or report user

Report or block ysangkok

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dune crash
% strace dune build
execve("/home/janus/.opam/4.07.1/bin/dune", ["dune", "build"], 0x7ffc567998b8 /* 78 vars */) = 0
brk(NULL) = 0x5569048c3000
access("/etc/", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=160499, ...}) = 0
mmap(NULL, 160499, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4db5c16000
close(3) = 0
access("/etc/", F_OK) = -1 ENOENT (No such file or directory)
View gist:d5e82c391b781e6d3c3054c739f73dd9
-22: TX rejected: failed to validate input eace631a89acb603bd8132d8e513ff0b9d3f18f1b0b895ff699c315353ef870e:6 which references output cacc27d34f9280efcd21b82877da71db181e99c7faad67d94d1cb228e343b2c3:1 - signature not empty on failed checksig (input witness [], input script bytes 47304402202041c3561fb6824302019b77b0f3c85d2b32a7d5b49cec7ef0a38d8ce958510102206f7d6459c1919ccff9184cf1db4ca4a80b5d0030ad1259af46b893cbe7bc3558012103941518fb527c286f2429e252cc8e016465bb21a80603f661dd798c9a7208c364, prev output script bytes 76a914d94ef28ade5e25db005a198aa4ffe99965f324ec88ac)
-22: TX rejected: failed to validate input eace631a89acb603bd8132d8e513ff0b9d3f18f1b0b895ff699c315353ef870e:4 which references output aa0a385bf94d15daafeda48b5ee5eb3ef5711138aafe610d232daf9bc3fbc3ef:1 - signature not empty on failed checksig (input witness [], input script bytes 473044022058ef633f6bed136db82d35d87d59ac5320e6b96e7f2abe89ee47a77700ba90e202200e38030062a57ec40211daeb8dc32b6e7ca2141d53c73f7b1fba278e4bfdd9dd0121034e66a1221b0c5e239fa67419
View gist:ae8ce1726036a18604ba4289149d01a7
2019-02-15 06:05:06.544 [INF] SYNC: Syncing to block height 1457192 from peer
2019-02-15 06:12:53.223 [INF] SYNC: Processed 1 block in the last 19m31.74s (129 transactions, height 1457193, 2019-02-15 06:12:41 +0100 CET)
2019-02-15 06:33:02.344 [INF] CHAN: Adding orphan block 00000000000fa89d8e3f1f594c58ee3d269661c35f3077db26060cfeef15a4f1 with parent 00000000000366ac6559456707eec35b673
2019-02-15 06:33:03.007 [INF] CHAN: FORK: Block 00000000000366ac6559456707eec35b673c735b2b5b66461cf60eaa99ce5c77 forks the chain at height 1457192/block 000000000000003
4ccc2c3b3aa4c3aceee23b2fd0527ba06f09dc1d4222d3929, but does not cause a reorganize
2019-02-15 06:33:03.013 [INF] CHAN: REORGANIZE: Block 00000000000fa89d8e3f1f594c58ee3d269661c35f3077db26060cfeef15a4f1 is causing a reorganize.
fatal error: sync: Unlock of unlocked RWMutex
goroutine 100 [running]:
View gist:6df35079a02e742265ed8c4b2ef208bb
Exception during reset or similar
Traceback (most recent call last):
File "/home/janus/.local/lib/python3.6/site-packages/sqlalchemy/pool/", line 671, in _finalize_fairy
File "/home/janus/.local/lib/python3.6/site-packages/sqlalchemy/pool/", line 858, in _reset
File "/home/janus/.local/lib/python3.6/site-packages/sqlalchemy/engine/", line 496, in do_rollback
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139864512661248 and this is thread id 139864716584768.
View gist:19a3319983011939879aebd2645b83e0
[Channel][lnchannel_2444db44] receive_revocation
[Peer][localhost:9735] Exception in wrapper_func : KeyError(2,)
Traceback (most recent call last):
File "/home/janus/Skrivebord/lightning-rfc/tools/electrum/electrum/", line 916, in wrapper
return await func(*args, **kwargs)
File "/home/janus/Skrivebord/lightning-rfc/tools/electrum/electrum/", line 202, in wrapper_func
return await func(self, *args, **kwargs)
File "/home/janus/Skrivebord/lightning-rfc/tools/electrum/electrum/", line 219, in main_loop
await self._main_loop()
File "/home/janus/Skrivebord/lightning-rfc/tools/electrum/electrum/", line 230, in _main_loop
View gist:22b98f460328d142ff3b9714d63fe437
I am wondering if the first two roundtrips of pre-committing and then revealing R/r in MuSig signing can be moved to the keygen phase and made deterministic. That reduces the amount of messages that need to be exchanged, since keygen is done only once and we want to expand that phase. This would be especially useful for HD wallets so that at the expense of making wallet creation more complicated, signing needs fewer interactions.
The [musig paper]( on page 11, "Signing" specifies that signer 1:
1. sends t<sub>1</sub>=H<sub>com</sub>(R<sub>1</sub>)
2. receives t<sub>i</sub>
3. sends R<sub>1</sub>
4. receives R<sub>i</sub>
5. checks that H<sub>com</sub>(R<sub>i</sub>)==t<sub>i</sub>
import threading
import asyncio
import time
import json
import subprocess
import colorama
import os
from utils import BitcoinRpc
from electrumutils import ElectrumX, ElectrumNode
View gist:e4dbb2fdce9d594a706196bbdf3e170c
Traceback (most recent call last):
File "/home/janus/Skrivebord/lightning-rfc/tools/electrum/electrum/plugins/labels/", line 77, in do_post
return await result.json()
File "/home/janus/.local/lib/python3.6/site-packages/aiohttp/", line 947, in json
return loads(stripped.decode(encoding))
File "/usr/lib/python3.6/json/", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/", line 342, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 3 column 2 (char 74)
View gist:ac62b994dc0679fe51b1e5a13f7da872
% rm -rf ../electrumx-db/ && mkdir -p ../electrumx-db && COIN=BitcoinSegwit SSL_KEYFILE=$PWD/key.pem SSL_CERTFILE=$PWD/cert.pem TCP_PORT=51001 SSL_PORT=51002 RPC_PORT=8000 NET=regtest DAEMON_URL=http://doggman:donkey@ DB_DIRECTORY=$PWD/../electrumx-db ./electrumx_server
WARNING:Env:lowered maximum sessions from 1,000 to 674 because your open file limit is 1,024
INFO:Controller:Python version: 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
INFO:Controller:software version: ElectrumX 1.8.7
INFO:Controller:aiorpcX version: 0.8.1
INFO:Controller:supported protocol versions: 1.1-1.4
INFO:Controller:event loop policy: None
INFO:Controller:reorg limit is 8,000 blocks
INFO:Daemon:daemon #1 at (current)
View electrum_lnd_test
You need
- expect(1), package expect on Ubuntu
- bitcoind/bitcoin-cli 0.16 (with wallet. tested with 686e97a0c) in $PATH
- lnd (tested with 26f68da5b2883885fcf6a8e79b3fc9bb12cc9eef)
- electrum on lightning
- electrumx
- jq ('lightweight and flexible command-line JSON processor')
You can’t perform that action at this time.