Skip to content

Instantly share code, notes, and snippets.

Justin Moon justinmoon

Block or report user

Report or block justinmoon

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 gist:1a0ab86a2bed3f9942ba064692d4bff3
HIGHLY EXPERIMENTAL
Windows .exe to connect hardware wallets to Bitcoin Core.
Some guidance:
Use testnet (get coins here). This is untested and buggy.
Only connect to Bitcoin Nodes running on the same device as junction. Connections to remote nodes are VERY INSECURE right now, and the UI won't complain.
Bitcoin Core versions below 18.0 are not supported
Required bitcoin.conf parameters:
View gist:133df0ff5c0de0e6b22471df027f1d20
[3302] Error loading Python lib '/tmp/_MEIzr3RJx/libpython3.7m.so.1.0': dlopen: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/_MEIzr3RJx/libpython3.7m.so.1.0)
View gist:f6d4d69ab86608256d495f59e436c7fa
$ ./lightningd/lightningd --log-level=io
2019-10-07T03:24:31.543Z UNUSUAL lightningd(18406): Creating configuration directory /home/justin/.lightning
2019-10-07T03:24:31.546Z DEBUG plugin-manager started(18407) /home/justin/dev/github/c-lightning/lightningd/../plugins/fundchannel
2019-10-07T03:24:31.549Z DEBUG plugin-manager started(18408) /home/justin/dev/github/c-lightning/lightningd/../plugins/pay
2019-10-07T03:24:31.550Z DEBUG plugin-manager started(18409) /home/justin/dev/github/c-lightning/lightningd/../plugins/autoclean
2019-10-07T03:24:31.551Z DEBUG plugin-manager started(18410) /home/justin/dev/github/c-lightning/lightningd/../plugins/helloworld.py
2019-10-07T03:24:31.552Z plugin-helloworld.py[OUT] 7b226a736f6e727063223a22322e30222c226964223a332c226d6574686f64223a226765746d616e6966657374222c22706172616d73223a7b7d7d0a0a
2019-10-07T03:24:31.552Z plugin-autoclean[OUT] 7b226a736f6e727063223a22322e30222c226964223a322c226d6574686f64223a226765746d616e6966657374222c22706172616d73223a7b7d7d0a0a
2019-10-07T03:
@justinmoon
justinmoon / snowball.md
Created Sep 25, 2019
snowball protocol (rough draft)
View snowball.md

General Workflow

  • Mobile wallet prepares a transaction in PSBT format
  • Mobile wallet calls snowball.enroll(psbt)
    • Invites all connected peers to add equal-sized inputs and outputs to the PSBT
    • Asynchronous with timeout
    • This would take soem kind of settings object including:
      • Who pays the fees
      • TODO: what else
  • Mobile wallet updates outputs to according to fee settings and desired fee rate
View hwi issue
In encounter the following error attempting to install HWI using Poetry on Windows 10:
```
$ poetry install
...
$ poetry shell
$ hwi enumerate
Traceback (most recent call last):
File "C:\Users\justin\AppData\Local\pypoetry\Cache\virtualenvs\HWI-py3.7\Scripts\hwi-script.py", line 6, in <module>
from pkg_resources import load_entry_point
View desktop.py
from flaskwebgui import FlaskUI #get the FlaskUI class
from dev import app
ui = FlaskUI(app)
ui.run()
View enumerate.py
from hwilib import commands
print(commands.enumerate())
@justinmoon
justinmoon / app.py
Last active Aug 13, 2019
Issue unlocking a trezor
View app.py
from flask import Flask, render_template_string, request, redirect
from hwilib import commands
from hwilib.devices import trezor
app = Flask(__name__)
template = """
<div>Locked? {{ locked }}</div>
<form action="/" method="post">
<label for="pin">Pin:</label>
View mnemonic.py
from m5stack import LCD, fonts, color565
from m import secure_mnemonic
lcd = LCD()
lcd.set_font(fonts.tt24)
lcd.erase()
def title(s):
# calculations
View m.py
from hashlib import sha256
# justin
def randbits(n):
import os
return int.from_bytes(os.urandom(int(n/8)), 'big')
def secure_mnemonic(entropy=0, num_bits=128):
You can’t perform that action at this time.