This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX = "kaspa" # kaspa/kaspatest | |
VERSION = 0 # PubKey = 0 | PubKeyECDSA = 1 | ScriptHash = 8 | |
CHARSET = b"qpzry9x8gf2tvdw0s3jn54khce6mua7l" | |
REV_CHARSET = {c: i for i, c in enumerate(CHARSET)} | |
P = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F | |
A = 0x0000000000000000000000000000000000000000000000000000000000000000 | |
B = 0x0000000000000000000000000000000000000000000000000000000000000007 | |
G = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
import random | |
P = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F | |
a = 0x0000000000000000000000000000000000000000000000000000000000000000 | |
b = 0x0000000000000000000000000000000000000000000000000000000000000007 | |
PLUS_G = ( | |
55066263022277343669578718895168534326250603453777594175500187360389116729240, | |
32670510020758816978083085130507043184471273380659243275938904335757337482424, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Параметры кривой secp256k1 | |
import copy | |
import math | |
import random | |
P = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F | |
a = 0x0000000000000000000000000000000000000000000000000000000000000000 | |
b = 0x0000000000000000000000000000000000000000000000000000000000000007 | |
PLUS_G = ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
from bs4 import BeautifulSoup | |
def parse(pages): | |
output = [] | |
offset = 1 | |
for _ in range(pages): | |
link = f"https://api.coinmarketcap.com/dexer/v3/platformpage/pair-pages?platform-id=1&dexer-id=1069&" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
import sys | |
import pymunk | |
import pymunk.pygame_util | |
pygame.init() | |
WINDOW_WIDTH = 800 | |
WINDOW_HEIGHT = 600 | |
FRAMERATE = 60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def int_to_binary_with_fixed_length(n, length): | |
binary_repr = format(n, f"0{length}b") | |
return binary_repr | |
def modify_binary(binary_repr): | |
new_binary_repr = "1" + binary_repr[:-1] | |
return new_binary_repr | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Параметры кривой secp256k1 | |
p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f | |
a = 0x0000000000000000000000000000000000000000000000000000000000000000 | |
b = 0x0000000000000000000000000000000000000000000000000000000000000007 | |
Gx = int(0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798) | |
Gy = int(0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8) | |
n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 | |
def is_on_secp256k1(x, y): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ecdsa | |
import random | |
import libnum | |
import hashlib | |
G = ecdsa.SECP256k1.generator | |
ORDER = G.order() | |