This file contains 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 * as secp from '@noble/secp256k1' | |
import ripemd160 from 'ripemd160-js/ripemd160.mjs' | |
import * as sha3 from 'js-sha3' | |
import { createHash } from 'node:crypto' | |
import { binary_to_base58 } from 'base58-js' | |
// Generate public key for private key of number 1 (or any number between 1 and ~10^77) | |
const privateKey = Buffer.alloc(32) | |
privateKey.writeUInt8(0x1, 31) |
This file contains 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
const fs = require('fs'); | |
const eccryptoJS = require('eccrypto-js'); | |
const coinkey = require('coinkey'); | |
const convertToEncryptStruct = (encbuf) => { | |
let offset = 0; | |
let tagLength = 32; | |
let pub; | |
switch(encbuf[0]) { | |
case 4: |
This file contains 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
const jeton = require('jeton-lib') | |
const PrivateKey = jeton.PrivateKey | |
const PublicKey = jeton.PublicKey | |
const Signature = jeton.Signature | |
const OutputScript = jeton.escrow.OutputScript | |
const Transaction = jeton.Transaction | |
// Create the output script | |
var refpk = new PublicKey("029ba4d2d14a5c24e4b7b6aa953ecf24b599e2f5e944412a9d60e5878f0f6a06cd") |