Skip to content

Instantly share code, notes, and snippets.

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

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 Feb 24, 2020
decorator validation
View index.ts
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 Aug 23, 2019
static image viewer
View img_viewer.html
<!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="" />
View main.py
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 = "/"
View SpanExample.cs
using System;
namespace ConsoleApp1
{
internal class Program
{
private static void Main(string[] args)
{
var stringData = "hello Steve";
var dangerousSpan = stringData.AsSpan();