Transactions
const EC = require('elliptic').ec
const ec = new EC('secp256k1')
const sha256 = require("sha256")
const privateKey, recipient, amount, message
const timestamp = Date.now(); // Generate current timestamp
const wallet = ec.keyFromPrivate(privateKey); // Get wallet from private key
const fullAddress = wallet.getPublic('hex'); // Full public address of sender
const sender = wallet.getPublic().getX().toString(16); // Shortened public key (X-coordinate)
const hash = sha256(sender + recipient + amount + message + timestamp).toString(); // Hash the transaction details
const sign = wallet.sign(hash); // Sign the transaction hash
const signature = sign.toDER('hex'); // Convert the signature to hex formatLast updated