Skip to content

Instantly share code, notes, and snippets.

View coreyphillips's full-sized avatar

Corey coreyphillips

View GitHub Profile
@t-bast
t-bast / better-lightning-address.md
Last active February 6, 2024 12:15
Future of lightning address

Lightning Address

Lightning Address is a very popular protocol that brings UX improvements that users love. We'd like to provide those UX benefits without its privacy and security drawbacks.

Issues with the current lightning address protocol

As described here, the lightning address protocol requires payment senders to make an HTTP request to the recipient's domain owner. This has some inconvenient side effects:

// npm i hypercore@10.0.0-alpha.24 hyperswarm@3.0.1
// Run `node create-hypercore.js` and pass the resulting key to https://gist.github.com/Nazeh/721368b93729dcfa00049c9de230f2ad
const Hypercore = require('hypercore');
const Hyperswarm = require('hyperswarm');
const createCore = async () => {
const core = new Hypercore('origin', { valueEncoding: 'json' });
await core.ready();
// Add blocks here if you want.
// npm i hypercore@next hyperswarm@next random-access-memory
// Run `node resolve-hypercore.js <key you get from https://gist.github.com/Nazeh/60291b111f93928d8110ff0ae9ecea25>
const Hypercore = require('hypercore');
const Hyperswarm = require('hyperswarm');
const ram = require('random-access-memory');
const resolveCore = async (key) => {
const core = new Hypercore(ram, key, { valueEncoding: 'json' });
await core.ready();
@josibake
josibake / 22.0-release-test-guide.md
Last active August 17, 2021 08:09
22 release test guide draft

Testing Guide: Bitcoin Core 22.0 Release Candidate

This document outlines some of the upcoming Bitcoin Core 22.0 release changes and provides steps to help. This is meant to get you started on testing, but is in no way comprehensive! After running through the steps in this guide, you are encouraged to do your own testing.

This can be as simple as testing the same features in this guide, but trying it a different way. Even better, think of features you use regularly and test that they still work as expected in the release candidate. You can also read the release notes to find something not covered in this guide. This is a great way to be involved with Bitcoin's development and helps keep Bitcoin running smoothly and bug free! Your help in this endeavor is greatly appreciated.

Overview

Changes covered in this testing guide include:

@Kixunil
Kixunil / efficient_reusable_taproot_addresses.md
Last active April 14, 2023 22:07
Efficient reusable Taproot addresses

Reusable taproot addresses

Abstract

This document proposes a new scheme to avoid address reuse while retaining some of the convenience of address reuse, keeping recoverability purely from Bitcoin time chain and avoiding visible fingerprint. The scheme has negligible average overhead.

Motivation

@t-bast
t-bast / phoenix-splicing.md
Created May 12, 2021 17:21
Phoenix in a splicing future (a.k.a death to all swaps)

Phoenix in a splicing future (a.k.a death to all swaps)

Phoenix implements trusted swaps for users' convenience (to allow easy onboarding and offboarding). But it's not a satisfying solution for the following reasons:

  • It uses two on-chain transactions for swap-in where one should be sufficient (one transaction from the user to Acinq followed by a channel open)
  • Swap-out feerates are unpredictable (because we may fund the swap-out with unconfirmed previous outputs) which is frustrating for users
  • It forces Acinq to use its own utxos, which doesn't scale well and is an operational burden
  • If Acinq doesn't have any utxos available and the mempool is completely full, swaps are stuck which is also frustrating for users
@kyleshevlin
kyleshevlin / memoizedHandlers.js
Created January 22, 2021 00:26
Using React.useMemo to create a `handlers` object
// One of my new favorite React Hook patternms is to create handler
// functions for a custom hook using `React.useMemo` instead of
// `React.useCallback`, like so:
function useBool(initialState = false) {
const [state, setState] = React.useState(initialState)
// Instead of individual React.useCallbacks gathered into an object
// Let's memoize the whole object. Then, we can destructure the
// methods we need in our consuming component.
@mutatrum
mutatrum / getbitcoinpdf.sh
Created January 21, 2021 16:15
Get bitcoin.pdf from the bitcoin blockchain in one line
bitcoin-cli getrawtransaction 54e48e5f5c656b26c3bca14a8c95aa583d07ebe84dde3b7dd4a78f4e4186e713 | sed 's/0100000000000000/\n/g' | tail -n +2 | cut -c7-136,139-268,271-400 | tr -d '\n' | cut -c17-368600 | xxd -p -r > bitcoin.pdf
import React from 'react';
import {View, Dimensions} from 'react-native';
import Animated, {
useAnimatedScrollHandler,
useAnimatedStyle,
useSharedValue,
} from 'react-native-reanimated';
const BORDER_RADIUS = 10;
@kelset
kelset / build-time-improvements.md
Last active June 21, 2023 19:25
This is kind of a blogpost about my experience of diving deep to improve some timings for an iOS React Native app

Improving times for both iOS build and CI for a React Native app

Intro

Hello there.

So, if you are here you probably saw my previous tweet where I asked for tips & tricks on improving the timing on an iOS/React Native app build time.

What will follow was how I mixed those suggestions + some good old GoogleSearch-fu + me deep diving on this for ~2 days.