Skip to content

Instantly share code, notes, and snippets.

@etherx-dev
etherx-dev / P2EP-for-JM.md
Created February 15, 2021 03:45 — forked from AdamISZ/P2EP-for-JM.md
Basic payjoin/p2ep protocol for Joinmarket wallets

Described here is a variant of what has previously been published under the name "P2EP" or Pay-to-endpoint, in which A pays B but B contributes utxos, i.e. it's a coinjoin-payment.

I'm using the term "payjoin" here to refer to using that idea, but not including a URI/endpoint specific to B, and not allowing (as a merchant would) arbitrary payments, which opens up certain problems around snooping attackers (more on this below). So payjoin just means "A pays B but B actively participates and passes across utxos as extra inputs".

I'll defer a more features-focused and non-tech friendly description of what this means to a later blogpost.

Hal Finney's explanation of secp256k1 "efficiently computable endomorphism" parameters used secp256k1 libraries, archived from source.

The same optimization could be applied to any Koblitz curve (e.g. Short Weistrass curve with a=0).


I implemented an optimized ECDSA verify for the secp256k1 curve, based on pages 125-129 of the Guide to Elliptic Curve Cryptography, by Hankerson, Menezes and Vanstone. I own the book but I also found a PDF on a Russian site which is more convenient.

secp256k1 uses the following prime for its x and y coordinates:

a googler
@etherx-dev
etherx-dev / messages.c
Last active April 3, 2021 06:18 — forked from taviso/messages.c
Enumerating Windows Messages ( PROOF OF CONCEPT) - (i guess, this is so weired)... https://googleprojectzero.blogspot.com/2019/08/down-rabbit-hole.html#ftnt1 <-- "plain text" file RCE exploit in windows.
#include <windows.h>
#include <stdio.h>
#include <stdint.h>
#pragma comment(lib, "USER32")
FARPROC NtUserPostMessage;
BOOL CALLBACK QueryWindowMessageProc(HWND Window, LPARAM Param)
{
{
"0xe3ffc9a3": [
"sendEtherToOwner()"
],
"0x5629c6d9": [
"doExecution(address)"
],
"0xe2deaa81": [
"set_reference(uint256,uint256,uint256)"
],
import binascii
import hashlib
import codecs
import mmap
import sys
import ecdsa
import base58
# Define base58str
def base58str(address_hex):
@etherx-dev
etherx-dev / gist:e0763150e0f95096051bb83dd8396449
Created October 24, 2021 22:09 — forked from LaurentMT/gist:e758767ca4038ac40aaf
Bitcoin Transactions & Privacy (part 1)
This document is an attempt to define metrics quantifying the degree of privacy provided by a bitcoin transaction.
Objectives
Definition of metrics measuring the resistance of a transaction to a set of attacks against users privacy.
Attacks considered in the scope of these metrics are:
- Merged Inputs Heuristic: methods identifying the inputs controlled by a same entity
- Coinjoin Sudoku: methods identifying the links existing between the inputs and outputs of a transaction
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.14 (GNU/Linux)
mQINBGF15iUBEADthQjDB0rFH61YFm2o6co9omS21oaHNvCQdlSIjNiUDqt+wZ+A
GftK72M18C5eME3Vg2AY9epvIr82wl+kHQTGiQVks/2LT6mW2oJaQcsPuIK+Fxiq
DxoeDMa3BVLjEq7572g10tbBVaUV1HkKoqOESXlKOWmYErdzrGjccZT7jj2rHTNn
vOvugBtGkJZOyF0R+lrHdm6R0mcHyTeWC9AWVgd1a9hf7KEf+gucOlWfZOTZwqGI
2VmS4fWOXqAcAUDzpuKsjmBiO/tZcRpCYwxop3W9IR7sYCXHVFvK+I/hirHV9vfQ
8u7b7AnchYwY+W7+CNr/EvREWKKb6ApUXW/wUAQKCjmtbW9/lMt4cJNA/a8SZCpP
22oidmIUuVsZNX7vv/AY4+F4j/jfNE+LCjLAiyU3+lEjpMhceYrNBabMq2gDfNLG
@etherx-dev
etherx-dev / balanced_merkle_path_update.md
Created November 14, 2021 19:03 — forked from gavinandresen/balanced_merkle_path_update.md
Updating old paths (witnesses) for a balanced merkle forest accumulator

Introduction

It would be spiffy to use the balanced merkle forest idea for ethereum tokens or to store unspent transaction outputs.

Tadge Dryja has been working on 'utreexo' (presentation) for storing unspent transaction outputs in log(n) space; this gist is inspired by, and is very similar to, that work.

So my previous gist describes really simple algorithms for adding and removing items from a balanced merkle forest. This gist extends those operations to create

@etherx-dev
etherx-dev / requires python binanace api
Last active April 9, 2024 23:26
Crypto Currency address Regular Expressions - extracted from the binance api on 31/03/2022
from binance.client import Client
from binance.exceptions import BinanceAPIException, BinanceRequestException
#incomplete but i just need a useful regex
client = Client("apikey", "secret")
coininfo = client.get_all_coins_info()
for coin in coininfo:
for network in (coin['networkList']):
print(coin['name'],network['addressRegex'])