Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@AdamISZ
AdamISZ / chaumian.md
Last active May 19, 2024 04:13
Chaumian ecash designs, notes

Chaumian cash in a Bitcoin world - cashu, Fedimint

What's this for?

  • More scalable/faster than a blockchain (not enough utxos)
  • Much better privacy security model than a blockchain
  • Same or better theft security model than TTP but much worse than a blockchain

If it's so great, why hasn't it been done yet?

@eskema
eskema / nostr-rs-relay_no-docker.md
Last active July 18, 2023 08:42
How to install nostr-rs-relay on ubuntu without Docker

These are the steps I took to install and run a nostr relay on a new server.

First, you'll need the server, this tutorial is using the most basic server Hetzner provides (CX11 - €4.15/mo), you don't need much. If you don't know where to get your server from and decide to go with Hetzner, consider using my affiliate link: https://hetzner.cloud/?ref=4FZql6rUwaeQ

Once you have your server running, log into it via SSH. I'm on a MacOS, so I'll use Terminal as my command line tool. open a new Terminal window and paste the following commands:

@LarryRuane
LarryRuane / static_assert.c
Last active August 27, 2022 15:29
example static assert implemention
#define static_assert(c) do { int _x = 1/((int)c); } while (0)
int main() {
static_assert(sizeof(int) == 4);
static_assert(sizeof(int) < 4);
return 0;
}
/* output:
$ gcc t.c
@vishalxl
vishalxl / GetNostrEvents.dart
Last active February 18, 2023 04:34
Get Nostr Events from a Relay
import 'dart:io';
import 'dart:convert';
String serverUrl = 'wss://nostr-pub.wellorder.net';
var userPublickey = "3235036bd0957dfb27ccda02d452d7c763be40c91a1ac082ba6983b25238388c";
var userSubReq = '["REQ","latest",{ "authors": ["$userPublickey"], "limit": 5 } ]';
class EventData {
String id;
String pubkey;
@vishalxl
vishalxl / Nostr Through Command Line.md
Last active April 12, 2023 04:07
Nostr commands for Bash Terminal on Linux ( also available on Windows 10 as Ubuntu WSL)

Read Events On Command Line

Print all events:

This would print the latest 100 events:

echo '["REQ", "a", {"limit": 100} ]' | websocat wss://nostr-pub.wellorder.net

Pretty print all events

@laanwj
laanwj / easyrpc.py
Last active April 5, 2024 12:53
Bitcoind RPC example from Python
'''
Convenience utility for connecting to a bitcoind instance through RPC.
'''
# W.J. van der Laan 2021 :: SPDX-License-Identifier: MIT
import base64
import decimal
from http import HTTPStatus
import http.client
import json
import logging
@AdamISZ
AdamISZ / sqrt_commit.py
Created April 26, 2022 07:27
Square root scaling for polynomial commitments
#!usr/bin/env python
""" Implementation example of https://eprint.iacr.org/2016/263.pdf
Bootle et al. Section 3, polynomial evaluation protocol which scales
in the square root of the degree.
*Not* zero knowledge form.
"""
import jmbitcoin as btc
import struct
@RubenSomsen
RubenSomsen / Silent_Payments.md
Last active May 16, 2024 23:31
Silent Payments – Receive private payments from anyone on a single static address without requiring any interaction or extra on-chain overhead

Silent Payments

Receive private payments from anyone on a single static address without requiring any interaction or extra on-chain overhead.

Update: This now has a BIP and WIP implementation

Overview

The recipient generates a so-called silent payment address and makes it publicly known. The sender then takes a public key from one of their chosen inputs for the payment, and uses it to derive a shared secret that is then used to tweak the silent payment address. The recipient detects the payment by scanning every transaction in the blockchain.

@LarryRuane
LarryRuane / bgrant2022.md
Last active August 27, 2022 15:30
brink full time grant application

Dear Brink Board,

Thanks to 20% support from Brink, I've been very fortunate to work part-time on Bitcoin Core engineering, mostly review, for almost a year. These are some of the accomplishments during this time:

  • biweekly calls with John Newbery until he stepped away, during which we discussed code review best practices, how to host review club, Bitcoin Core design philosophy, thread safety, book recommendations (both ways), suggestions for PRs to review and specifics of some of those, release engineering (version numbers, tagging), debugging, and many other topics
  • hosted Review Club three times (14707,
(ns secp256k1
(:import (java.util Arrays)
(java.security MessageDigest)
(java.nio.charset StandardCharsets)))
(defrecord Point [^BigInteger x ^BigInteger y])
(def infinity (->Point nil nil))
(def ^BigInteger zero BigInteger/ZERO)