@cboseak/

CaringYawningWrenchbird

Python 2.7

No description

fork
loading
Files
  • main.py
  • coins.txt

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.7533806683928286","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"IyEgL3Vzci9iaW4vZW52IHB5dGhvbgoKIiIiCmJ1cm4tYnRjOiBjcmVhdGUgYSBiaXRjb2luIGJ1cm4gYWRkcmVzcwpCeSBKYW1lcyBDLiBTdHJvdWQKVGhpcyBwcm9ncmFtIHJlcXVyaWVzIGJhc2U1OCAoaHR0cHM6Ly9weXBpLnB5dGhvbi5vcmcvcHlwaS9iYXNlNTgvMC4yLjEpLgpDYWxsIHRoZSBwcm9ncmFtIHdpdGggYSB0ZW1wbGF0ZSBidXJuIGFkZHJlc3MgYXMgdGhlIG9ubHkgYXJndW1lbnQ6OgogICAgJSBidXJuLWJ0YyAxQnVybkJUQ0ZvckZ1bkJ1cm5CVENGb3JGdW5YWFhYWFhYCiAgICAxQnVybkJUQ0ZvckZ1bkJ1cm5CVENGb3JGdW5YVG1KWHJDCkZvciBpbnN0cnVjdGlvbnMsIGNhbGwgdGhlIHByb2dyYW0gd2l0aCBubyBhcmd1bWVudHM6OgogICAgJSBidXJuLWJ0YwogICAgdXNhZ2U6IGJ1cm4tYnRjIFRFTVBMQVRFCiAgICAgICBURU1QTEFURSAtIDM0IGxldHRlcnMgJiBudW1iZXJzIChubyB6ZXJvcykKICAgICAgICAgICAgICAgICAgdGhlIGZpcnN0IHR3byBhcmUgY29pbiBzcGVjaWZpYwpBbiBleGFtcGxlIHRlbXBsYXRlIGlzIGFjY2Vzc2libGUgdXNpbmcgInRlc3QiIGFzIHRoZSBhcmd1bWVudDo6CiAgICAlIGJ1cm4tYnRjIHRlc3QKICAgIDFCdXJuQlRDRm9yRnVuQnVybkJUQ0ZvckZ1blhUbUpYckMKVmFsaWRhdGUgYml0Y29pbiBidXJuIGFkZHJlc3NlcyBhdCBodHRwOi8vdW5jYX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QgbGV0dGVycyAmIG51bWJlcnMgKG5vIHplcm9zKSIKICBwcmludCAiICAgICAgICAgICAgICB0aGUgZmlyc3QgdHdvIGFyZSBjb2luIHNwZWNpZmljIgogIHJhaXNlIFN5c3RlbUV4aXQKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CgogICAgdGVtcGxhdGUgPSAiMWt0aGlzaXNhZHVtYldBTExFVCIKCiAgICBmb3IgYyBpbiB0ZW1wbGF0ZToKICAgICAgIGlmIGMgbm90IGluIEFCRVQ6CiAgICAgICAgICAgIHJhaXNlIEFscGhhYmV0RXJyb3IoIkNoYXJhY3RlciAnJXMnIGlzIG5vdCB2YWxpZCBiYXNlNTguIiAlIGMpCiAgICB0bGVuID0gbGVuKHRlbXBsYXRlKQogICAgaWYgdGxlbiA8IDM0OgogICAgICB0ZW1wbGF0ZSA9IHRlbXBsYXRlICsgKCgzNCAtIHRsZW4pICogIlgiKQogICAgZWxzZToKICAgICAgdGVtcGxhdGUgPSB0ZW1wbGF0ZVs6MzRdCiAgICBwcmludCBidXJuKHRlbXBsYXRlKQogIAogIAogIAogIAogIAogIAogIA=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#! /usr/bin/env python

"""
burn-btc: create a bitcoin burn address
By James C. Stroud
This program requries base58 (https://pypi.python.org/pypi/base58/0.2.1).
Call the program with a template burn address as the only argument::
    % burn-btc 1BurnBTCForFunBurnBTCForFunXXXXXXX
    1BurnBTCForFunBurnBTCForFunXTmJXrC
For instructions, call the program with no arguments::
    % burn-btc
    usage: burn-btc TEMPLATE
       TEMPLATE - 34 letters & numbers (no zeros)
                  the first two are coin specific
An example template is accessible using "test" as the argument::
    % burn-btc test
    1BurnBTCForFunBurnBTCForFunXTmJXrC
Validate bitcoin burn addresses at http://uncaptcha.net/bitcoin.php
"""

import sys
import binascii

from hashlib import sha256

from base58 import b58encode, b58decode

ABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

class BurnBTCError(Exception):
  pass

class AlphabetError(BurnBTCError):
  pass

def hh256(s):
  s = sha256(s).digest()
  return binascii.hexlify(sha256(s).digest())

def b58ec(s):
  unencoded = str(bytearray.fromhex(unicode(s)))
  encoded = b58encode(unencoded)
  return encoded

def b58dc(encoded, trim=0):
  unencoded = b58decode(encoded)[:-trim]
  return unencoded

def burn(s):
  decoded = b58dc(s, trim=4)
  decoded_hex = binascii.hexlify(decoded)
  check = hh256(decoded)[:8]
  coded = decoded_hex + check
  return b58ec(coded)

def usage():
  print "usage: burn-btc TEMPLATE"
  print
  print "   TEMPLATE - 34 letters & numbers (no zeros)"
  print "              the first two are coin specific"
  raise SystemExit

if __name__ == "__main__":

    template = "1kthisisadumbWALLET"

    for c in template:
       if c not in ABET:
            raise AlphabetError("Character '%s' is not valid base58." % c)
    tlen = len(template)
    if tlen < 34:
      template = template + ((34 - tlen) * "X")
    else:
      template = template[:34]
    print burn(template)