Skip to content
Common Lisp toolbox to work with the Monero cryptocurrency
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
emacs
src
tests
.gitignore
LICENSE
README.org Fix typo in README Feb 17, 2019
monero-tools-p2p.asd
monero-tools-rpc.asd
monero-tools.asd

README.org

Monero tools

This is a Common Lisp toolbox to work with the Monero cryptocurrency.

The monero-tools system contains basic tools that can be used offline. The monero-tools-rpc system contains tools requiring a running monerod or/and monero-wallet-rpc daemon to connect to.

This library is in alpha quality stage, so the API might change.

Installation

To load the monero-tools library, put it in a directory where your Common Lisp implementation can see it, and use the usual:

(asdf:load-system "monero-tools")

or

(ql:quickload "monero-tools")

monero-tools dependencies

monero-tools requires the following libraries:

  • alexandria
  • babel
  • bordeaux-threads
  • cffi
  • cl-json
  • cl-octet-streams
  • cl-ppcre
  • cl-qrencode
  • ieee-floats
  • ironclad
  • png-read
  • split-sequence

Optional:

  • the unbound C library (to resolve OpenAlias names)
  • the zbar C library (to read QR codes)

If the optional C libraries are not available, the system should load successfully but some functions will not work.

monero-tools-rpc dependencies

monero-tools-rpc requires the following libraries:

  • bordeaux-threads
  • cl-base64
  • cl-json
  • dexador
  • ironclad
  • monero-tools
  • pzmq
  • split-sequence

Basic tools

After loading the monero-tools system, the following functions and variables are in the monero-tools package.

Blockchain

  • acceptable-hash-p
  • compute-block-hash
  • compute-block-hash-from-data
  • compute-miner-transaction-hash
  • compute-miner-transaction-hash-from-data
  • compute-transaction-hash
  • compute-transaction-hash-from-data
  • compute-transaction-tree-hash

Cryptography

  • *cryptonight-height*
  • *cryptonight-variant*
  • chacha8
  • chacha20
  • compute-key-image
  • compute-multisig-blinded-secret
  • compute-multisig-keys-m/n
  • compute-multisig-keys-n/n
  • compute-multisig-public-keys
  • compute-multisig-public-spend-key
  • compute-multisig-secret-spend-key
  • compute-multisig-secret-view-key
  • compute-subaddress-indexes-table
  • derive-key
  • derive-output-public-key
  • derive-output-secret-key
  • derive-output-secret-subkey
  • derive-public-spend-subkey
  • derive-secret-spend-subkey
  • derive-subkey-secret
  • fast-hash
  • generate-chacha-key
  • generate-keys
  • generate-secret-key
  • generate-ring-signature
  • generate-signature
  • output-public-key->public-spend-subkey
  • public-spend-subkey->public-view-subkey
  • recover-keys
  • secret-key->public-key
  • secret-spend-key->secret-view-key
  • slow-hash
  • tree-hash
  • valid-ring-signature-p
  • valid-signature-p

Mining

  • miner
  • mining-profitability

Mnemonic seed

  • available-mnemonic-seed-languages
  • decrypt-mnemonic-seed
  • encrypt-mnemonic-seed
  • mnemonic-seed->secret-key
  • secret-key->mnemonic-seed

OpenAlias

  • *dns-server*
  • *dnssec-trust-anchors*
  • get-openalias-info

Serialization

  • deserialize-block
  • deserialize-block-header
  • deserialize-from-binary-storage
  • deserialize-transaction
  • deserialize-transaction-prefix
  • serialize-block
  • serialize-block-header
  • serialize-to-binary-storage
  • serialize-transaction
  • serialize-transaction-prefix

Utils

  • base58-decode
  • base58-encode
  • bytes->hex-string
  • bytes->integer
  • bytes->string
  • bytes->utf-8-string
  • decode-json-from-string
  • encode-json-to-string
  • format-float
  • geta
  • hex-string->bytes
  • integer->bytes
  • read-float
  • string->bytes
  • utf-8-string->bytes

Wallet

  • +monero-unit+
  • bruteforce-wallet-keys
  • decode-address
  • decode-multisig-extra-info
  • decode-multisig-info
  • decode-multisig-seed
  • decode-qr-code
  • decode-uri
  • decrypt-amount
  • decrypt-payment-id
  • encrypt-payment-id
  • get-wallet-keys
  • make-integrated-address
  • make-multisig-extra-info
  • make-multisig-info
  • make-multisig-seed
  • make-qr-code
  • make-uri
  • output-destination-address
  • output-for-address-p
  • prove-inbound-transaction
  • prove-outbound-transaction
  • prove-payment
  • public-keys->address
  • public-keys->subaddress
  • received-amount
  • secret-spend-key->address
  • secret-spend-key->subaddress
  • sign-file
  • sign-message
  • spent-key-images
  • valid-address-p
  • valid-file-signature-p
  • valid-inbound-transaction-proof-p
  • valid-message-signature-p
  • valid-outbound-transaction-proof-p
  • valid-payment-proof-p

RPC tools

After loading the monero-tools-rpc system, the following functions and variables are available.

Basic remote procedure call

The basic RPC functions and variables are in the monero-tools-rpc package.

  • *rpc-host*
  • *rpc-password*
  • *rpc-port*
  • *rpc-user*
  • json-rpc
  • rpc
  • zmq-json-rpc

Calling monerod

The functions and variables for daemon RPCs are in the monero-tools-daemon-rpc package.

HTTP JSON RPCs

The following functions are thin wrappers for the HTTP JSON RPCs of monerod. They use alists instead of JSON objects, where a key named some_key in a JSON object becomes :some-key in the alist. The specifications of these RPCs can be found in https://getmonero.org/resources/developer-guides/daemon-rpc.html.

  • flush-txpool
  • get-alternate-chain
  • get-bans
  • get-block
  • get-block-count
  • get-block-hash
  • get-block-header-by-hash
  • get-block-header-by-height
  • get-block-headers-range
  • get-block-template
  • get-coinbase-tx-sum
  • get-connections
  • get-fee-estimate
  • get-info
  • get-last-block-header
  • get-output-distribution
  • get-output-histogram
  • get-txpool-backlog
  • get-version
  • hard-fork-info
  • relay-tx
  • set-bans
  • submit-block
  • sync-info

Other HTTP RPCs

The following functions are thin wrappers for the HTTP RPCs of monerod. They use alists instead of JSON objects, where a key named some_key in a JSON object becomes :some-key in the alist. The specifications of these RPCs can be found in https://getmonero.org/resources/developer-guides/daemon-rpc.html.

  • get-alt-blocks-hashes
  • get-blocks.bin
  • get-blocks-by-height.bin
  • get-hashes.bin
  • get-limit
  • get-o-indexes.bin
  • get-outs
  • get-outs.bin
  • get-peer-list
  • get-random-outs.bin
  • get-random-rctouts.bin
  • get-transaction-pool
  • get-transaction-pool-hashes
  • get-transaction-pool-hashes.bin
  • get-transaction-pool-stats
  • get-transactions
  • in-peers
  • is-key-image-spent
  • mining-status
  • out-peers
  • save-bc
  • set-limit
  • set-log-categories
  • set-log-hashrate
  • set-log-level
  • start-mining
  • stop-daemon
  • stop-mining
  • update

ZeroMQ RPCs

  • zmq-get-block
  • zmq-get-info
  • zmq-get-transactions

Custom RPCs

Mining

  • mine-block

Wallet

  • transaction-history

Calling monero-wallet-rpc

The functions and variables for wallet RPCs are in the monero-tools-wallet-rpc package.

HTTP JSON RPCs

The following functions are thin wrappers for the HTTP JSON RPCs of monero-wallet-rpc. They use alists instead of JSON objects, where a key named some_key in a JSON object becomes :some-key in the alist. The specifications of these RPCs can be found in https://getmonero.org/resources/developer-guides/wallet-rpc.html.

  • add-address-book
  • change-wallet-password
  • check-reserve-proof
  • check-spend-proof
  • check-tx-key
  • check-tx-proof
  • close-wallet
  • create-account
  • create-address
  • create-wallet
  • delete-address-book
  • export-key-images
  • export-multisig-info
  • export-outputs
  • finalize-multisig
  • get-account-tags
  • get-accounts
  • get-address
  • get-address-book
  • get-address-index
  • get-attribute
  • get-balance
  • get-bulk-payments
  • get-height
  • get-languages
  • get-payments
  • get-reserve-proof
  • get-spend-proof
  • get-transfer-by-txid
  • get-transfers
  • get-tx-key
  • get-tx-notes
  • get-tx-proof
  • get-version
  • import-key-images
  • import-multisig-info
  • import-outputs
  • incoming_transfers
  • is-multisig
  • label-account
  • label-address
  • make-integrated-address
  • make-multisig
  • make-uri
  • open-wallet
  • parse-uri
  • prepare-multisig
  • query-key
  • refresh
  • relay-tx
  • rescan-blockchain
  • rescan-spent
  • set-account-tag-description
  • set-attribute
  • set-tx-notes
  • sign
  • sign-multisig
  • sign-transfer
  • split-integrated-address
  • start-mining
  • stop-mining
  • stop-wallet
  • store
  • submit-multisig
  • submit-transfer
  • sweep-all
  • sweep-dust
  • sweep-single
  • tag-accounts
  • transfer
  • transfer-split
  • untag-accounts
  • verify

Tests

The tests require the fiveam library.

(asdf:test-system "monero-tools")
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.