Skip to content

Instantly share code, notes, and snippets.

@loon3
loon3 / rare.js
Created June 26, 2024 15:57
rare pepes on arweave
//images are at "https://arweave.net/"+rarePepes[i].arweave
const rarePepes = [{'asset': 'BABERUTHPEPE', 'arweave': 'dzQFZGbYSWKw2OaDItQf3HRjiwwOJGVh76Z1eN4KWCU'}, {'asset': 'BACHELORPEPE', 'arweave': 'wCqtidB6yDEbHJVtRQO7HG63YOGCxrL7MrVNP3JI2IU'}, {'asset': 'BACKPAGEPEPE', 'arweave': 'FgmuiVZalXvZ9c8DdvVUj0plgtXIKCaIedDtESXtwB0'}, {'asset': 'BACKTOPEPE', 'arweave': 'VivrBJwhBwmNVjW_m1JY7G-RRm1JpACqkAYChkUYjmo'}, {'asset': 'BADASSPEPE', 'arweave': 'FLUK5D8m5JQ-RfRVbFMzaBsH-kvELb88jBWWQsvulz0'}, {'asset': 'BADHAIRDAY', 'arweave': 'eA_bLSURNNpSg-Xnqp8FerArsYuajAzhJNScMgMAbP0'}, {'asset': 'BADLTPEPE', 'arweave': 'qypVBLVjavnTti9sGbOVfO6dePmRRZPeKNEPRdn_fr0'}, {'asset': 'BADWISHES', 'arweave': 'gs9w_7iS7pTbWGJ_iAkespId7gIc2d907NYpgvflVR4'}, {'asset': 'BAGHOLDRPEPE', 'arweave': 'KSTEX_PEHuq3EOxGRg97jIGhYVAVec3Eq7IHTKVgrJE'}, {'asset': 'BANANAPEPE', 'arweave': 'QLHdFxkrQYCqsWfwudPoS8jUksHKi4D8P7vju34Qd7Q'}, {'asset': 'BANDAGEDPEPE', 'arweave': 'aekOK8Pqr18Fm19MklUzbYOiazJWucqgpoXJCP6gR-I'}, {'asset': 'BANEPEPE', '
@loon3
loon3 / Client.php
Created January 14, 2024 16:30
Counterparty API - PHP example
<?php
namespace JsonRPC;
use Exception;
use BadFunctionCallException;
use InvalidArgumentException;
use RuntimeException;
class ConnectionFailureException extends Exception {};
class ServerErrorException extends Exception {};
/**
* JsonRPC client class
@loon3
loon3 / psbt.md
Last active January 4, 2024 21:44
Counterparty Asset PSBTs for BTC market

Counterparty Asset PSBT Structure

Note: Uses Counterparty send message type ID = 0

Party A (Seller)

  1. Inputs:

    • Input 1: 546 satoshis (from Party A's address).
  2. Outputs:

  • Output 1: 546 satoshis intended for Party B's address which becomes asset recipient (address is alterable).
@loon3
loon3 / filterBlock.py
Created May 23, 2023 14:25
filter blocks for burned sats
import os
import requests
import json
import subprocess
from bitcoin.core import b2lx, b2x, CBlock
from bitcoin.core.script import OP_RETURN, CScript
from Crypto.Cipher import ARC4
def read_cookie_file(cookie_file_path):
@loon3
loon3 / clock.py
Created March 9, 2023 20:57
Create your own Brick Brock Clock
from PIL import Image, ImageDraw
import math
import numpy as np
# Load input image
input_image = Image.open("brick.png")
# Create blank output image
output_image = Image.new("RGB", (1200, 1200), "white")
@loon3
loon3 / 12x12-random.py
Created March 7, 2023 18:31
twelvefold-python
from PIL import Image
import random
# Load the input image and convert it to RGBA mode
input_image = Image.open("input_image.png").convert("RGBA")
# Calculate the size of each grid cell based on the input image size
cell_width = 200
cell_height = 200
@loon3
loon3 / ecies-bitcoin-example.js
Created August 26, 2022 17:57
ECIES Bitcoin Example
import { encrypt, decrypt } from 'eciesjs'
var bitcoinjs = require('bitcoinjs-lib')
let aliceKeyPriv = bitcoinjs.ECPair.fromWIF("5KAHnHT2x4XMFnjVZZJNkbmDKB8qtTZrqmotNwe4F8g31nvnpTN").privateKey
let aliceKeyPub = bitcoinjs.ECPair.fromWIF("5KAHnHT2x4XMFnjVZZJNkbmDKB8qtTZrqmotNwe4F8g31nvnpTN").publicKey
let data = Buffer.from('this is a test')
let final = decrypt(aliceKeyPriv, encrypt(aliceKeyPub, data)).toString()
console.log(final)
@loon3
loon3 / BtcBlockDates2021.csv
Created April 5, 2022 02:11
Bitcoin Block Height by Date, 2021
We can't make this file beautiful and searchable because it's too large.
01-01-2021,663945
01-01-2021,663946
01-01-2021,663947
01-01-2021,663948
01-01-2021,663949
01-01-2021,663950
01-01-2021,663951
01-01-2021,663952
01-01-2021,663953
01-01-2021,663954
<?php
header('Content-Type: application/json');
require 'includes/Client.php';
use JsonRPC\Client;
$cp_server = 'http://public.coindaddy.io:4000/api/';
$cp_user = 'rpc';
$cp_password = '1234';
@loon3
loon3 / gist:4ead91dab16d410004a0a865ef36906b
Created May 2, 2019 18:26
message verification server
var express = require('express');
var app = express();
var port = process.env.PORT || 8080;
var Message = require('bitcore-message');
//var mysql = require('mysql');
// start the server
app.listen(port);