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 { createECDH } from 'crypto' | |
import elliptic from 'elliptic' | |
import { deriveAddress } from 'ripple-keypairs' | |
const curve = 'secp256k1' | |
const secp256k1 = elliptic.ec(curve) | |
const bytesToHex = a => a.map(byteValue => ('0' + byteValue.toString(16)).slice(-2)).join('') | |
const getPublic = echdObj => bytesToHex(secp256k1.keyFromPrivate(echdObj.getPrivateKey()).getPublic().encodeCompressed()) |
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 { | |
enableEmit, | |
getState, | |
setState, | |
prepareEmit, | |
doEmit, | |
log, | |
AnyJson, | |
} from '@xahau/hooks' |
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 accountlib from 'xrpl-accountlib' | |
import assert from 'assert' | |
const requiredBits = 256 | |
const requiredThrows = Math.ceil(requiredBits / Math.log2(10)) | |
// Adapted from validator keypair dice tool by RichardAH | |
// https://github.com/RichardAH/validator-keys-from-dice/blob/main/dice.js | |
// Random (BAD RANDOM! BAD BAD BAD RANDOM! DO NOT EVER USE THIS!! TESTING PURPOSES ONLY!) |
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 accountlib from 'xrpl-accountlib' | |
import elliptic from 'elliptic' | |
import assert from 'assert' | |
const ec = new elliptic.eddsa('ed25519') | |
// Adapted from validator keypair dice tool by RichardAH | |
// https://github.com/RichardAH/validator-keys-from-dice/blob/main/dice.js | |
// Random (BAD RANDOM! BAD BAD BAD RANDOM! DO NOT EVER USE THIS!! TESTING PURPOSES ONLY!) | |
const dicerolls = Array(78).fill().map(r => Math.floor(Math.random() * 10)) |
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 { derive, utils, prefilledSignAndSubmit, XrplClient } from "xrpl-accountlib" | |
const sample = 'xahauTestnet' | |
const sampleValues = { | |
xahauTestnet: { | |
account: derive.familySeed('sstWn1vCjnf6vFT87QHoYJpzYrdu9'), | |
nodes: [ | |
new XrplClient('wss://xahau-test.net'), | |
new XrplClient('wss://hooks-testnet-v3.xrpl-labs.com'), |
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
<! -- Demo here: https://zoq4jb3.dlvr.cloud/index.html --> | |
<html> | |
<head> | |
<style> | |
pre { | |
border: 1px solid red; | |
padding: 10px; | |
margin: 10px; | |
} | |
</style> |
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
#!/bin/bash | |
# Detect CVE-2024-2961 and mitigage (tested: Ubuntu & Debian & Proxmox hosts) | |
# Wietse Wind 10-05-2024 | |
# Based on the idea from https://raw.githubusercontent.com/mattaperkins/FIX-CVE-2024-2961/main/fix.sh | |
# ^^ Changes I made: auto detect file (several files eligible instead of one) & create back up of patched file | |
# Finds the right file and patches | |
# Safely run again to verify patch | |
# Run on host: | |
# curl https://gist.githubusercontent.com/WietseWind/9fe2eda3fece426bf873a4aeb15c4267/raw/patch.sh | bash |
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 { | |
// generate, | |
derive | |
} from 'xrpl-accountlib' | |
import rippleAddressCodec from 'ripple-address-codec' | |
import { | |
sign, | |
verify |
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
update=2024.4.21-release+858 | |
cd /opt/xahaud/downloads/ && \ | |
wget https://build.xahau.tech/"$update" && \ | |
cd /opt/xahaud/bin && \ | |
service xahaud stop && \ | |
rm xahaud && \ | |
ln -s ../downloads/$update ./xahaud && \ | |
chmod +x ./xahaud && service xahaud start |
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 vm = require('vm') | |
const sandbox = {} | |
// https://cdn.jsdelivr.net/npm/xrpl-accountlib/dist/browser.min.js | |
vm.runInNewContext(fs.readFileSync('browser.min.js'), sandbox) | |
var AccountLib = sandbox.require('xrpl-accountlib') |