Skip to content

Instantly share code, notes, and snippets.

View kristapsk's full-sized avatar

Kristaps Kaupe kristapsk

View GitHub Profile
@ValdikSS
ValdikSS / gist:c13a82ca4a2d8b7e87ff
Last active January 23, 2024 18:42
TrueCrypt hack info
  • Developers have responded:

https://www.grc.com/misc/truecrypt/truecrypt.htm | https://twitter.com/stevebarnhart/status/472192457145597952

Steven Barnhart (@stevebarnhart) wrote to an eMail address he had used before and received several replies from “David.” The following snippets were taken from a twitter conversation which then took place between Steven Barnhart (@stevebarnhart) and Matthew Green (@matthew_d_green):

TrueCrypt Developer “David”: “We were happy with the audit, it didn't spark anything. We worked hard on this for 10 years, nothing lasts forever.”

Steven Barnhart: (Paraphrasing) Developer “personally” feels that fork is harmful: “The source is still available as a reference though.” >

@chris-belcher
chris-belcher / pro-decentralization-link-list.md
Last active January 7, 2024 15:10
pro-decentralization-link-list

A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.

Abstract

The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.

@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@mflaxman
mflaxman / trezor_recovery.py
Created August 15, 2017 13:50
Proof you can recover your Trezor funds without a Trezor (if it breaks and/or the company goes out of business)
from bitmerchant.wallet import Wallet
from mnemonic import Mnemonic
# put in whatever Trezor generates for you here (or backup from this empty/insecure one as a test)
mnemonic = 'clean health food open blood network differ female lion eagle rough upon update zone antique defense venture uncover mobile charge actress film vocal enough'
passphrase = '' # empty string or whatever you actually choose
path = "m/44'/0'/0'/0/0" # whatever shows up on the UI for that account (everything will start with m/44'/0' since it's bip44)
child = Wallet.from_master_secret(Mnemonic('english').to_seed(mnemonic, passphrase)).get_child_for_path(path)
child.to_address() # '18K9axbPpwqZgngB58nuwsYevL2z6ey4YG' (confirm this matches what Trezor is showing you)
@SamouraiDev
SamouraiDev / gist:4ced85a29996dd56781e2bf319b93aaf
Last active April 5, 2023 07:41
STONEWALL spend description
Utxos are grouped by address type (P2PKH, P2SH-P2WPKH, or P2WPKH).
The group with the same address type as the address being spent to is selected if it is >= twice the spend amount.
If the above condition is not met, then a group with a different address type and a total value >= twice the spend amount is selected.
If the above condition is not met, then 2 groups with total amounts >= the spend amount are chosen.
Transaction composition is arranged by “sets”.
For each set:
The utxos are processed in randomised order.
@fernandonm
fernandonm / bitcoin_derivatives.md
Last active May 29, 2019 08:03
Trust-minimized derivatives

Trust-minimized derivatives

Options contracts can be implemented as trust-minimized smart contracts using Bitcoin script. These contracts don't require oracles feeding the price into the blockchain or any other trusted third party. Recipients will only trust miners to mine (and not reverse) transactions paying a reasonable feerate, securing their payouts.

The underlier of these derivatives can be any digital asset available on a blockchain that can do HLTCs.

Call options

The buyer of an American-style call binary option pays a premium (eg: 0.1 BTC) for <seller secret> wich gives the right to buy Q units (quantity) of the underlying asset (100 LTC) at a specified strike price (0.016 BTC per LTC) at any time until the expiration date.

Dave's Beautiful BCH 0conf Exploit

For Educational and Informational Purposes Only. The information contained in this Gist is for educational and informational purposes only, and is made available to you for your own use.


This hypothetical exploit details how a malicious actor could steal goods or services from a merchant using Bitcoin Cash. This exploit takes advantage of the acceptance of unconfirmed transactions in the Bitcoin Cash community.

Imagine you have 4 BCH addresses, with funds on address 1. Just before you pay the merchant, you send 3 transactions in quick succession this order.

Unequal Amount Mixing for ZeroLink using Preferred Value Series Fixed Denominations

This is a quick sketch of several modifications to zerolink. This document tries to articulate an as of yet unproven intuition is that combined together they can allow unequal input amounts as well as relaxation of the post-mix no linking restriction, while retaining the same conservative assumptions about mixed output indistinguishability.

Disallowing post-mix linking is arguably bad for fungibility, since users are likely to bypass this restriction by transferring to other wallets. Therefore, if I am able to justify this change this seems like a much more substantial contribution to usability and fungibility. That said even if it can't be shown to be reasonable to do so, some of these ideas still have merit on their own, so not all would be lost.

Proposed Protocol Changes

"Soft Fork" changes

@AdamISZ
AdamISZ / P2EP-for-JM.md
Created December 27, 2018 18:48
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.