Skip to content

Instantly share code, notes, and snippets.

@longj3418
longj3418 / send_counterparty_from_trezor.py
Created November 5, 2019 11:03 — forked from sorce/send_counterparty_from_trezor.py
Create, sign and send a counterparty transaction from an address controlled by a trezor
#!/usr/bin/env python
'''
if you find this script helpful and would like to give some crypto to
the cause, we would be very happy to receive it :)
donate bitcoin / counterparty: 3L19gTtMMJHpkAjYVduUZETdduwAfM7NGR
'''
import sys
import json
import requests
from requests.auth import HTTPBasicAuth
#!/usr/bin/env python
import sys
import json
import requests
from decimal import Decimal
import logging
from logging.handlers import RotatingFileHandler
worklog = logging.getLogger('sweep_funds')
#shandler = logging.handlers.RotatingFileHandler('sweep_funds.log', maxBytes=1024*1024*10, backupCount=1000)
@longj3418
longj3418 / ecdsa_demo.py
Created October 2, 2019 06:29 — forked from nlitsme/ecdsa_demo.py
python implementation of ecdsa calculations, demonstrating how to recover a private key from two signatures with identical 'r', and demonstrating how to find the public key from a signature and message, or from two signatures.
"""
By Willem Hengeveld <itsme@xs4all.nl>
ecdsa implementation in python
demonstrating several 'unconventional' calculations,
like finding a public key from a signature,
and finding a private key from 2 signatures with identical 'r'
"""
# (gcd,c,d)= GCD(a, b) ===> a*c+b*d!=gcd:
# Copyright 2014 Chris Cohen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Copyright 2014 Chris Cohen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the