| Name | Description |
|---|---|
| vin | list of inputs |
| vout | list of outputs |
| Name | Description |
|---|
| import math | |
| def mergesort(arr, helper=None, low=0, high=None): | |
| print(arr, helper, low, high) | |
| if high == None: | |
| print("Setting high...") | |
| high = len(arr) - 1 | |
| if helper is None: | |
| print("Setting helper...") |
| import math | |
| def search(l, term, offset=0): | |
| # find the middle | |
| # find length of list and divide by two | |
| list_len = len(l) | |
| if list_len <= 0: | |
| return None | |
| middle = math.floor(list_len / 2) |
| /** | |
| * Proof of concept for a KYC-enabled digital currency | |
| * In short, a user submits their information to a KYC provider (Oracle) along with proof of identity (similar to Jumio, etc.) | |
| * KYC provider provides signature for the user's identity. | |
| * | |
| * The user can then share pieces of the identity with the relevant | |
| * signature for transactions. This logic can even be part of the transaction validation logic of the digital currency. | |
| * What follows is just a simple example that can be run via NodeJS. | |
| */ |
| const RIPEMD160 = require('ripemd160'); | |
| const EC = require('elliptic').ec; | |
| const sha256 = require('js-sha256'); | |
| const ec = new EC('secp256k1'); // Bitcoin uses Elliptic Curve Digital Signing Algorithm (ECDSA) to verify transactions | |
| let message = 'I want to send this money'; // This would normally be the transaction hash with amount of money, publicScriptKey | |
| let publicKey = '040c1fbe8b870d636823963ff21ba6e5250571848714203a08ae8700e0d97a1d7bb94ae888af72ac9a4fe02d558599d27c8986398902fa9ac0c1654f5839db1af5'; | |
| let privateKey = '2ec6d2808dc7b9d11e49516cfc747435feae8e9872d63c92bc5bde68a894199f'; |
| const secureRandom = require('secure-random'); | |
| const ec = require('elliptic').ec; | |
| const ecdsa = new ec('secp256k1'); | |
| function generateAddress() { | |
| const max = Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140", 'hex'); | |
| let isInvalid = true; | |
| let privateKey; | |
| while (isInvalid) { |
| const net = require('net'); | |
| const network = require('network'); | |
| const uuid = require('uuid'); | |
| const SHA256 = require('js-sha256'); | |
| const port = parseInt(process.env.PORT); | |
| function handleConnection(conn) { | |
| console.log('> New client connection: ', conn.remoteAddress, conn.remotePort); | |
| conn.setEncoding('utf8'); |
| Verifying my Blockstack ID is secured with the address 1BWE9yVyk8hvDfoKCqMSSLQ6UvE7veo1yN https://explorer.blockstack.org/address/1BWE9yVyk8hvDfoKCqMSSLQ6UvE7veo1yN |
| import decode from 'jwt-decode'; | |
| import jwt from 'njwt'; | |
| import { ec } from 'elliptic'; | |
| var eccrypto = require('eccrypto'); | |
| var crypto = require('crypto'); | |
| // sender | |
| var privKey1 = crypto.randomBytes(32); | |
| var pubKey1 = eccrypto.getPublic(privKey1); |
| import BlockClass from 'classes/Block'; | |
| import BlockModel from 'models/Block'; | |
| import SHA256 from 'js-sha256'; | |
| import { isNodeSynced } from 'net/isNodeSynced'; | |
| import { isTxValid } from 'utils/validateBlock'; | |
| import request from 'utils/request'; | |
| import store from 'store/store'; | |
| const MIN_TX_PER_BLOCK = 1; |