Skip to content

Instantly share code, notes, and snippets.

@Sharpiro
Sharpiro / coinswap-design.md
Last active September 12, 2021 12:25 — forked from chris-belcher/coinswap-design.md
Design for a CoinSwap Implementation for Massively Improving Bitcoin Privacy and Fungibility

Design for a CoinSwap Implementation for Massively Improving Bitcoin Privacy and Fungibility

Abstract

Imagine a future where a user Alice has bitcoins and wants to send them with maximal privacy, so she creates a special kind of transaction. For anyone looking at the blockchain her transaction appears completely normal with her coins seemingly going from address A to address B. But in reality her coins end up in address Z which is entirely unconnected to either A or B.

Now imagine another user, Carol, who isn't too bothered by privacy and sends her bitcoin using a regular wallet which exists today. But because Carol's transaction looks exactly the same as Alice's, anybody analyzing the blockchain must now deal with the possibility that Carol's transaction actually sent her coins to a totally unconnected address. So Carol's privacy is improved even though she didn't change her behaviour, and perhaps had never even heard of this software.

In a world where advertisers, social media and other companies w

@Sharpiro
Sharpiro / index.ts
Created February 24, 2020 03:37
decorator validation
function Validate<T extends { new(...args: any[]): {} }>(constructor: T) {
return class extends constructor {
errors: string[]
constructor(...items: any[]) {
super(...items)
this.errors = []
for (const x in this) {
if (this[x] == undefined) {
this.errors.push(`property '${x}' was undefined on class '${constructor.name}'`)
@Sharpiro
Sharpiro / img_viewer.html
Last active August 23, 2019 19:44
static image viewer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta property="og:image" content="" />
<meta property="og:title" content="Image Viewer" />
<meta property="og:description" content="" />
@Sharpiro
Sharpiro / main.py
Created August 17, 2019 18:42
http request
import socket
# https://93.184.216.34/ # example.com
# http://52.239.152.74/tor-blobs/tor.txt # http://torpy.blob.core.windows.net/tor-blobs/tor.txt
# # example.com
# ip_address = "93.184.216.34"
# port = 80
# host = "example.com"
# path = "/"
using System;
namespace ConsoleApp1
{
internal class Program
{
private static void Main(string[] args)
{
var stringData = "hello Steve";
var dangerousSpan = stringData.AsSpan();