Skip to content

Instantly share code, notes, and snippets.

@bodily11
bodily11 / inscribe_p2wsh.py
Created July 21, 2023 12:25
Script to inscribe using P2WSH
import requests, secrets, os, binascii, base58
from copy import deepcopy
from hashlib import sha256
from bitcoin.core import COIN, b2x, b2lx, lx, Hash160, CMutableTransaction, CMutableTxOut, CMutableTxIn, CTxInWitness, CTxWitness, COutPoint, CTransaction
from bitcoin.core.script import CScript, OP_CHECKSIG, SIGHASH_ALL, CScriptWitness, OP_IF, OP_ENDIF, OP_1, OP_0, OP_FALSE, SignatureHash, OP_DUP, OP_HASH160, OP_EQUALVERIFY, SIGVERSION_WITNESS_V0
from bitcoin.core.scripteval import VerifyScript, SCRIPT_VERIFY_P2SH
from bitcoin.wallet import CBitcoinSecret, CBitcoinAddress, P2WSHBitcoinAddress, P2PKHBitcoinAddress
from bitcoin import SelectParams
def generate_private_key():
@rain-1
rain-1 / GPT-4 Reverse Turing Test.md
Last active July 10, 2025 23:15
GPT-4 Reverse Turing Test

The reverse turing test

I asked GPT-4 to come up with 10 questions to determine if the answerer was AI or human.

I provided my own answers for these questions and I also asked ChatGPT to answer them.

The result is that GPT-4 was able to correctly differentiate between AI and Human.

@spalladino
spalladino / falsehoods-that-ethereum-programmers-believe.md
Last active December 4, 2025 09:42
Falsehoods that Ethereum programmers believe

Falsehoods that Ethereum programmers believe

I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.

About Gas

Calling estimateGas will return the gas required by my transaction

Calling estimateGas will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i

@hewigovens
hewigovens / ens_namehash.swift
Last active November 9, 2018 06:53
ens namehash in swift
import Foundation
import CryptoSwift
//https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md
extension String {
public var namehash: String {
var node = Array<UInt8>.init(repeating: 0x0, count: 32)
if self.count > 0 {
node = self.split(separator: ".")
.map { Array($0.utf8).sha3(.keccak256) }