Payouts, sweeps and offline signing from your terminal
Pay many people from a CSV file, sweep a wallet, sign on an offline machine and run multisig. It starts on testnet and does a dry run unless you add --broadcast.
Modules, run examples, complete reference and FAQ.
Quick start
Build the tool from the repository. It needs Node 20 or later and produces one standalone file.
Shell
npm install --no-fund --no-audit # at the repository root
cd packages/cli && npm run build # writes dist/cli.mjs
node dist/cli.mjs --help
Make a testnet key, read its address and check it. The key goes to a file and is not printed.
Shell
$ dogejs key new --out sender.key
Wrote a new private key to sender.key (mode 0600). It is not shown here.
Network: testnet
Address: nfSdgWzYCxRb4DLXoam3iqX5iJh2cv2SoE
Keep a backup of the file. Anyone who reads it can spend the funds.
$ dogejs key address --key-file sender.key
Network: testnet
nfSdgWzYCxRb4DLXoam3iqX5iJh2cv2SoE 0386d02ed419c348f134eec450d160a7ad6860dbf3f5300def4d801e358ad380f2
$ dogejs address check nfSdgWzYCxRb4DLXoam3iqX5iJh2cv2SoE
Valid P2PKH address.
Network: testnet
Hash160: 7b6618327011d05a332b0a30d9acfd2af1e1a4a6
The examples call the tool dogejs. Replace it with node dist/cli.mjs, or link the file onto your path.
How it works
Testnet and dry run
The network is testnet unless you pass --network mainnet. Nothing is sent without --broadcast.
Keys stay in files
Keys and phrases come from --key-file, --key-env or a hidden prompt. The tool refuses a secret on the command line.
Inputs are checked
Each coin's previous transaction is fetched and verified, the fee is checked, and the server must be on the network you chose.
Sign offline
build writes an unsigned file, sign signs it on an offline machine, broadcast sends it.
There is no default server. Give your own indexer with --esplora URL, or your own Dogecoin Core node with --rpc URL. Every summary says who pays the fee. Output is plain ASCII when piped, and coloured tables and a boxed summary on a terminal.
Examples
PSBT for other wallets
A PSBT (BIP174) is the file that other wallets and hardware-wallet tools pass around. psbt turns a transaction file into one and back, and signs it with the same rules as sign: the previous transactions are required, the summary and fee check come first, and keys are read only from a file, the environment or a hidden prompt. PSBTs are written as base64 text (--hex for hex). A binary .psbt file is refused with a hint: convert it with base64 -w0 FILE.
A PSBT from another wallet may not say its network: pass --network. SegWit PSBTs are refused, because Dogecoin has no SegWit. The transcripts below show a real run.
Reference
Commands
Every command has --help and --json.
Command
What it does
key new
Create a random key (WIF) or a seed phrase and save it to a file with mode 0600.
key address
Show addresses for a key, seed phrase, extended key or public key. Never prints secrets.
address check
Check an address: checksum, type and network. Exit 0 if valid, 1 if not.
message sign
Sign a message like Dogecoin Core signmessagewithprivkey. Prints the base64 signature.
message verify
Verify a signed message like Dogecoin Core verifymessage. Exit 0 if valid, 1 if not.
balance
Show confirmed and unconfirmed balance of addresses, from your own indexer.
utxos
List the unspent outputs of addresses, from your own indexer.
build
Build an UNSIGNED transaction file from your indexer data (run this on the online machine).
sign
Sign a transaction file (run this on the offline machine). Reads keys from a file, the environment or a hidden prompt.
broadcast
Check a fully signed transaction file and, with --broadcast, send it through your own backend.
decode
Pretty-print a transaction: raw hex, a file containing hex, "-" for stdin, or a DogeJS transaction file.
sweep
Send everything from one or more keys to one destination. The destination pays the fee. Dry run by default.
payout
Pay many addresses from a CSV. Dry run by default; resumable without ever paying twice.
multisig create
Make an m-of-n multisig: redeem script and P2SH address from public keys, saved to a descriptor file.
multisig sign
Add one cosigner's signature to a transaction file. The file records which keys have signed.
multisig combine
Merge the signatures from several copies of the same transaction file.
psbt create, psbt convert
Turn a transaction file into a PSBT, or a PSBT back into a transaction file. Nothing is lost that both formats hold.
psbt inspect
Show a PSBT's values, addresses, fee and signatures. No key needed.
psbt sign, psbt combine, psbt finalize
Sign a PSBT (offline machine), merge copies signed by different cosigners, and build the final scripts.
psbt extract
Check a finalized PSBT and its fee, then print the signed transaction as hex.
watch
Wait for a payment to an address, or follow a payment you sent with --txid. Exits 0 when confirmed, 5 on timeout.
Flags
Flag
What it does
--network
testnet (default), mainnet or regtest. Mainnet asks you to type send on mainnet after a summary.
--yes-mainnet
For scripts: skip the typed confirmation. The summary is still printed.
--broadcast
Send. Without it, sweep, payout and broadcast are a dry run.
--key-file PATH
Read the key or phrase from a file.
--key-env NAME
Read it from the environment variable with this name.
--key-prompt
Type or paste it at a hidden prompt.
--esplora URL
Your own Esplora-style indexer. There is no default.
--rpc URL
Your own Dogecoin Core node. Core has no address index.
--rpc-auth-env NAME, --rpc-auth-file PATH
Where to read user:password for --rpc.
--psbt PATH
On build, sign, multisig sign and multisig combine: also write the result as a PSBT. --hex on psbt commands writes hex instead of base64.
--out PATH
Output file. Existing files are kept unless you pass --force.
--fee-rate DOGE/kB
The fee rate, default 0.01. The fee guards of @dogejs/core always apply.
--subtract-fee
Take the fee out of the amounts you typed. Recipients receive less.
--override-fee-guard
Accept a fee that failed the fee check, after you checked it yourself.
--csv FILE, --report FILE, --resume REPORT
Payout input, result report, and continuing an earlier payout.
--max-outputs N
Pay at most N addresses per transaction.
--gap N
For HD wallets, addresses to scan per chain. Default 20.
--json
One JSON object on stdout, errors included.
--no-color, --ascii
Turn colour off, or use plain ASCII symbols and box lines.
Exit codes
Code
Meaning
0
Success.
1
Failed: backend problem, invalid address or signature, rejected broadcast.
2
Usage error.
3
Refused by a safety rule or fee guard.
4
Invalid input file: CSV, transaction file, descriptor or plan.
5
watch timed out.
6
payout finished with unpaid rows.
Transaction file format
Files are dogejs-tx version 2, shared with the browser tools and written by @dogejs/core. Older files are still read. The file is read strictly, and unknown fields are an error.
Field
What it holds
format, version
"dogejs-tx" and 2.
network
testnet, mainnet or regtest.
state
unsigned, partial or signed. It must agree with the signatures.
unsignedTx
Hex of the transaction without signatures.
inputs[]
For each input: txid, vout, valueKoinu, script, the full prevTx, a redeemScript for multisig, and the signatures collected so far.
summary
Totals, outputs, fee and fee rate, for people. It is checked against the transaction on read.
note
Free text. It is shown labelled unverified.
checksum
SHA-256 over the canonical JSON of every other field. It catches accidental edits.
Every command and flag
Generated from the real --help text of each command in @dogejs/cli 0.3.1 (24 commands).
dogejs address check5 options
Check an address: checksum, type and network. Exit 0 if valid, 1 if not.
Base URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpc
URL
URL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-env
NAME
Name of an environment variable holding "user:password" for --rpc.
--rpc-auth-file
PATH
File holding "user:password" for --rpc (permissions are checked).
--network
NAME
Refuse unless the file is for this network (the network normally comes from the file).
--override-fee-guard
DANGEROUS: carry on although the fee check failed (fee far above what this size needs, or below the relay minimum). Only after you checked the fee yourself.
--broadcast
Actually send it. Without this flag the command only checks the file and prints the summary (a dry run).
--yes-mainnet
For scripts: skip the typed mainnet confirmation (the network comes from the file).
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs build19 options
Build an UNSIGNED transaction file from your indexer data (run this on the online machine).
testnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--yes-mainnet
For scripts: skip the typed mainnet confirmation. The summary is still printed.
--esplora
URL
Base URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpc
URL
URL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-env
NAME
Name of an environment variable holding "user:password" for --rpc.
--rpc-auth-file
PATH
File holding "user:password" for --rpc (permissions are checked).
--from
ADDRESS
Address to spend from (P2PKH, or the P2SH address of a --descriptor). Commas allowed. May be repeated.
--change
ADDRESS
Change address (default: the only --from address).
--descriptor
PATH
Multisig descriptor file for a P2SH --from address. May be repeated.
--allow-unconfirmed
Also spend unconfirmed outputs (default: confirmed only).
--subtract-fee
Take the fee out of the --to amounts (split equally) instead of adding it on top. Recipients then receive LESS than the amounts you typed; the summary shows each share.
--uncompressed-keys
The keys behind the P2PKH --from addresses are uncompressed (affects the size estimate only).
--out
PATH
Output file (default: a timestamped name in the current directory).
--force
Overwrite an existing output file. Without it, existing files are never touched.
--psbt
PATH
Also write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs decode5 options
Pretty-print a transaction: raw hex, a file containing hex, "-" for stdin, or a DogeJS transaction file.
Require this network. Without it the address network is detected.
--address
ADDRESS
The P2PKH address that should have signed.
--signature
BASE64
The signature (65 bytes, base64).
--message
TEXT
The message (UTF-8). Not a secret, so it may be on the command line.
--message-file
PATH
Read the message from a file (read exactly, trailing newline included).
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs multisig combine9 options
Merge the signatures from several copies of the same transaction file.
dogejs multisig combine FILE FILE... [--out FILE]
Flag
Value
What it does
--network
NAME
Refuse unless the file is for this network (the network normally comes from the file).
--override-fee-guard
DANGEROUS: carry on although the fee check failed (fee far above what this size needs, or below the relay minimum). Only after you checked the fee yourself.
--out
PATH
Output file (default: a timestamped name in the current directory).
--force
Overwrite an existing output file. Without it, existing files are never touched.
--psbt
PATH
Also write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs multisig create10 options
Make an m-of-n multisig: redeem script and P2SH address from public keys, saved to a descriptor file.
For scripts: skip the typed mainnet confirmation (the network comes from the file).
--network
NAME
Refuse unless the file is for this network (the network normally comes from the file).
--override-fee-guard
DANGEROUS: carry on although the fee check failed (fee far above what this size needs, or below the relay minimum). Only after you checked the fee yourself.
--key-file
PATH
File with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-env
NAME
Name of an environment variable that holds the same.
--key-prompt
Type or paste the secret at a hidden prompt.
--passphrase-env
NAME
Environment variable holding a BIP39 passphrase (seed phrases only).
--account
N
HD account number (default 0).
--coin-type
N
Override the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gap
N
HD wallets: addresses to scan per chain (external and change), default 20.
--out
PATH
Output file (default: a timestamped name in the current directory).
--force
Overwrite an existing output file. Without it, existing files are never touched.
--psbt
PATH
Also write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs payout27 options
Pay many addresses from a CSV. Dry run by default; resumable without ever paying twice.
testnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--yes-mainnet
For scripts: skip the typed mainnet confirmation. The summary is still printed.
--esplora
URL
Base URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpc
URL
URL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-env
NAME
Name of an environment variable holding "user:password" for --rpc.
--rpc-auth-file
PATH
File holding "user:password" for --rpc (permissions are checked).
--key-file
PATH
File with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-env
NAME
Name of an environment variable that holds the same.
--key-prompt
Type or paste the secret at a hidden prompt.
--passphrase-env
NAME
Environment variable holding a BIP39 passphrase (seed phrases only).
--account
N
HD account number (default 0).
--coin-type
N
Override the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gap
N
HD wallets: addresses to scan per chain (external and change), default 20.
--allow-unconfirmed
Also spend unconfirmed outputs (default: confirmed only).
--csv
FILE
Payments: header "address,amount" or "address,amount,label". Amounts are decimal DOGE strings.
--report
FILE
Result report CSV to create (default: timestamped). The plan goes to FILE.plan.json. Existing files are never overwritten.
--resume
REPORT
Continue a payout from its report. Re-sends only the transactions already signed in the plan.
--allow-duplicates
Allow the same address on several rows (default: refuse).
--max-outputs
N
Pay at most N addresses per transaction (default: as many as a standard transaction allows).
--change
ADDRESS
Where change goes (default: the first address of your key).
--subtract-fee
Take the fee out of the CSV amounts (split equally inside each transaction) instead of adding it on top. Recipients then receive LESS than the CSV says; the report shows what each receives.
--override-fee-guard
DANGEROUS: carry on although the fee check failed (fee far above what this size needs, or below the relay minimum). Only after you checked the fee yourself.
--broadcast
Send the transactions. Without it nothing is sent: you get the summary, the signed plan and the report.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs psbt combine7 options
Merge several PSBTs of the same transaction (for example copies signed by different cosigners).
The network, when the PSBT does not say (it must agree if it does).
--override-fee-guard
DANGEROUS: carry on although the fee check failed (fee far above what this size needs, or below the relay minimum). Only after you checked the fee yourself.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--out
PATH
Output file (default: a timestamped name in the current directory).
--force
Overwrite an existing output file. Without it, existing files are never touched.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs psbt finalize7 options
Build the final scriptSigs of every input that has enough valid signatures.
dogejs psbt finalize FILE [--out FILE] [--hex]
Flag
Value
What it does
--hex
Write the PSBT as hex instead of base64.
--out
PATH
Output file (default: a timestamped name in the current directory).
--force
Overwrite an existing output file. Without it, existing files are never touched.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs psbt inspect6 options
Show what a PSBT does: inputs and their values, outputs and addresses, fee, signatures. No key needed.
The network, when the PSBT does not say (it must agree if it does).
--override-fee-guard
DANGEROUS: carry on although the fee check failed (fee far above what this size needs, or below the relay minimum). Only after you checked the fee yourself.
--key-file
PATH
File with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-env
NAME
Name of an environment variable that holds the same.
--key-prompt
Type or paste the secret at a hidden prompt.
--passphrase-env
NAME
Environment variable holding a BIP39 passphrase (seed phrases only).
--account
N
HD account number (default 0).
--coin-type
N
Override the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gap
N
HD wallets: addresses to scan per chain (external and change), default 20.
--hex
Write the PSBT as hex instead of base64.
--out
PATH
Output file (default: a timestamped name in the current directory).
--force
Overwrite an existing output file. Without it, existing files are never touched.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs sign17 options
Sign a transaction file (run this on the offline machine). Reads keys from a file, the environment or a hidden prompt.
For scripts: skip the typed mainnet confirmation (the network comes from the file).
--network
NAME
Refuse unless the file is for this network (the network normally comes from the file).
--override-fee-guard
DANGEROUS: carry on although the fee check failed (fee far above what this size needs, or below the relay minimum). Only after you checked the fee yourself.
--key-file
PATH
File with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-env
NAME
Name of an environment variable that holds the same.
--key-prompt
Type or paste the secret at a hidden prompt.
--passphrase-env
NAME
Environment variable holding a BIP39 passphrase (seed phrases only).
--account
N
HD account number (default 0).
--coin-type
N
Override the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gap
N
HD wallets: addresses to scan per chain (external and change), default 20.
--out
PATH
Output file (default: a timestamped name in the current directory).
--force
Overwrite an existing output file. Without it, existing files are never touched.
--psbt
PATH
Also write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
dogejs sweep23 options
Send everything from one or more keys to one destination. The destination pays the fee. Dry run by default.
testnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--esplora
URL
Base URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpc
URL
URL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-env
NAME
Name of an environment variable holding "user:password" for --rpc.
--rpc-auth-file
PATH
File holding "user:password" for --rpc (permissions are checked).
--txid
TXID
Follow one transaction you sent (for example after "dogejs broadcast") instead of waiting for a payment to an address.
--amount
DOGE
Address mode: total to wait for, summed over payments (default: any amount, at least 1 koinu).
--confirmations
N
Confirmations needed (default 1).
--timeout
SECONDS
Give up after this long (exit 5). Default: wait until you stop it.
--poll
SECONDS
Seconds between checks (default 15).
--json
Machine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-color
No colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--ascii
Plain ASCII symbols and box lines (the default whenever output is piped).
--help
Show this help.
Payout CSV format
One header line and one payment per row: address,amount,label. The amount is a decimal DOGE string. The whole file is checked before anything happens; any problem stops the run with exit code 4 and nothing is done.
Every transcript below is the real output of the CLI against a fake indexer that ships with the test setup, on testnet.
Offline signing
build runs on the online machine and writes an unsigned file; sign runs offline and checks every input value; broadcast runs online again.
Terminal
$ dogejs balance nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub --esplora $INDEXER
Network: testnet
Address Confirmed DOGE Unconfirmed DOGE Outputs
---------------------------------- -------------- ---------------- -------
nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub 25.00 0.00 1
[exit 0]
$ dogejs build --from nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub --to nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv:5 --esplora $INDEXER --out unsigned.json
Reading unspent outputs and previous transactions from your backend...
+- Unsigned transaction ------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (25.00 DOGE) |
| Total sent: 5.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 5.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00226 DOGE |
| Paid by: You pay it. It comes on top of the amounts, so every recipient gets the full amount. |
| Fee rate: 0.01 DOGE/kB effective on 226 bytes (asked for 0.01 DOGE/kB) |
| Change: 19.99774 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00226 DOGE, limit 0.0226 DOGE) |
+-----------------------------------------------------------------------------------------------------+
Wrote unsigned.json (transaction file version 2). Next: copy it to the signing machine and run "dogejs sign unsigned.json".
[exit 0]
$ dogejs sign unsigned.json --key-file key.txt --out signed.json
Transaction in unsigned.json (every figure below is computed from the transaction itself, not copied from the file text):
+- Transaction to sign -------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (25.00 DOGE) |
| # DOGE From Status |
| - ----- ---------------------------------- -------- |
| 1 25.00 nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub unsigned |
| Total sent: 5.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 5.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00226 DOGE |
| Paid by: Inputs minus outputs: the fee is what the inputs hold beyond the outputs. Recipients |
| get exactly the amounts listed above. |
| Fee rate: 0.01 DOGE/kB effective on 226 bytes (asked for 0.01 DOGE/kB) |
| Change: 19.99774 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00226 DOGE, limit 0.03294 DOGE) |
| Note in file: "Built by dogejs build 0.3.1. Fee mode: standard." (unverified text) |
+-----------------------------------------------------------------------------------------------------+
[ok] signed. Wrote signed.json (txid ec45bfa88cf07f84e363f90eb63e2434627ebc9098ba9498b44c676787f02fbb). Next: "dogejs broadcast signed.json" on the online machine.
[exit 0]
$ dogejs broadcast signed.json --esplora $INDEXER
Transaction ec45bfa88cf07f84e363f90eb63e2434627ebc9098ba9498b44c676787f02fbb
+- Transaction to send -------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (25.00 DOGE) |
| Total sent: 5.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 5.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00226 DOGE |
| Paid by: Inputs minus outputs: the fee is what the inputs hold beyond the outputs. Recipients |
| get exactly the amounts listed above. |
| Fee rate: 0.01004444 DOGE/kB effective on 225 bytes (asked for 0.01 DOGE/kB) |
| Change: 19.99774 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00225 DOGE, limit 0.03284 DOGE) |
| Note in file: "Built by dogejs build 0.3.1. Fee mode: standard." (unverified text) |
+-----------------------------------------------------------------------------------------------------+
Dry run: nothing was sent. Add --broadcast to send it.
[exit 0]
$ dogejs broadcast signed.json --broadcast --esplora $INDEXER
Transaction ec45bfa88cf07f84e363f90eb63e2434627ebc9098ba9498b44c676787f02fbb
+- Transaction to send -------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (25.00 DOGE) |
| Total sent: 5.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 5.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00226 DOGE |
| Paid by: Inputs minus outputs: the fee is what the inputs hold beyond the outputs. Recipients |
| get exactly the amounts listed above. |
| Fee rate: 0.01004444 DOGE/kB effective on 225 bytes (asked for 0.01 DOGE/kB) |
| Change: 19.99774 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00225 DOGE, limit 0.03284 DOGE) |
| Note in file: "Built by dogejs build 0.3.1. Fee mode: standard." (unverified text) |
+-----------------------------------------------------------------------------------------------------+
[ok] sent. txid ec45bfa88cf07f84e363f90eb63e2434627ebc9098ba9498b44c676787f02fbb
Follow it with: dogejs watch --txid ec45bfa88cf07f84e363f90eb63e2434627ebc9098ba9498b44c676787f02fbb --network testnet --esplora URL
[exit 0]
$ dogejs balance nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv --esplora $INDEXER
Network: testnet
Address Confirmed DOGE Unconfirmed DOGE Outputs
---------------------------------- -------------- ---------------- -------
nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv 5.00 0.00 1
[exit 0]
Pay a CSV
Terminal
$ cat payouts.csv
address,amount,label
nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv,10,Alice
nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL,2.5,Bob
$ dogejs payout --csv payouts.csv --key-file key.txt --esplora $INDEXER --report report.csv
Payout CSV: 2 payments to 2 addresses, total 12.50 DOGE on testnet.
Reading unspent outputs and previous transactions from your backend...
+- Payout plan -------------------------------------------------------------------------------------+
| Network: testnet |
| Payments: 2 in 1 transaction (each under 100000 bytes) |
| Total sent: 12.50 DOGE |
| Fee: 0.0026 DOGE in total |
| Paid by: you. It comes on top of the amounts, so every recipient gets exactly the amount in |
| the CSV. |
| Outputs: 2 payments + 1 change |
| Change: 87.4974 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub (after the last transaction) |
+---------------------------------------------------------------------------------------------------+
Row DOGE To Label Tx Status
--- ----- ---------------------------------- ----- -- -------
1 10.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv Alice 1 planned
2 2.50 nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL Bob 1 planned
Wrote report.csv.plan.json (signed transactions) and report.csv.
Dry run: nothing was sent. To send: dogejs payout --resume report.csv --broadcast --esplora URL
Transactions
Tx Payments Fee DOGE Txid Status
-- -------- -------- ---------------------------------------------------------------- -------
1 2 0.0026 e6b33586f40825e76ee1f39e3d4bd59c1900f3cda5907e60e1ccee68d5d7ee89 planned
Report: report.csv
[!] Transactions: 0 of 1 sent.
[exit 0]
$ dogejs payout --csv payouts.csv --key-file key.txt --esplora $INDEXER --report report2.csv --broadcast
Payout CSV: 2 payments to 2 addresses, total 12.50 DOGE on testnet.
Reading unspent outputs and previous transactions from your backend...
+- Payout plan -------------------------------------------------------------------------------------+
| Network: testnet |
| Payments: 2 in 1 transaction (each under 100000 bytes) |
| Total sent: 12.50 DOGE |
| Fee: 0.0026 DOGE in total |
| Paid by: you. It comes on top of the amounts, so every recipient gets exactly the amount in |
| the CSV. |
| Outputs: 2 payments + 1 change |
| Change: 87.4974 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub (after the last transaction) |
+---------------------------------------------------------------------------------------------------+
Row DOGE To Label Tx Status
--- ----- ---------------------------------- ----- -- -------
1 10.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv Alice 1 planned
2 2.50 nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL Bob 1 planned
Wrote report2.csv.plan.json (signed transactions) and report2.csv.
[ok] batch 1/1: e6b33586f40825e76ee1f39e3d4bd59c1900f3cda5907e60e1ccee68d5d7ee89 accepted by the node (2 payments)
Transactions
Tx Payments Fee DOGE Txid Status
-- -------- -------- ---------------------------------------------------------------- ------
1 2 0.0026 e6b33586f40825e76ee1f39e3d4bd59c1900f3cda5907e60e1ccee68d5d7ee89 sent
Report: report2.csv
[ok] Transactions: 1 of 1 sent.
[exit 0]
$ cat report2.csv
row,line,address,amount,label,batch,status,txid,detail
1,2,nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv,10.00,Alice,1,sent,e6b33586f40825e76ee1f39e3d4bd59c1900f3cda5907e60e1ccee68d5d7ee89,accepted by the node
2,3,nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL,2.50,Bob,1,sent,e6b33586f40825e76ee1f39e3d4bd59c1900f3cda5907e60e1ccee68d5d7ee89,accepted by the node
Multisig
Terminal
$ dogejs multisig create --m 2 --sort --pubkey $PUB1 --pubkey $PUB2 --pubkey $PUB3 --out team.multisig.json
2-of-3 multisig on testnet
Address: 2N58atBmSrLnU9bBrRacAhoZf2pVZSJgNzf
Redeem script: 52210219ce4d0ef6710afaf62a5edd8e739bd05198823e7e66f05df41cd8f410bcb665210223da3838ba0217e0f3ed6bc2df5dc81b200311692b562ae00f6334187bc2611f2103e11f40af6b41f494bfbc27c47a178ce572e8b8ca687cc67e1298514861ac5e4853ae
Wrote team.multisig.json. Every cosigner should check that the address matches.
[exit 0]
$ dogejs build --from $VAULT --descriptor team.multisig.json --to nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv:8 --esplora $INDEXER --out vault.json
Reading unspent outputs and previous transactions from your backend...
+- Unsigned transaction ------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (40.00 DOGE) |
| Total sent: 8.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 8.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00373 DOGE |
| Paid by: You pay it. It comes on top of the amounts, so every recipient gets the full amount. |
| Fee rate: 0.01 DOGE/kB effective on 373 bytes (asked for 0.01 DOGE/kB) |
| Change: 31.99627 DOGE to 2N58atBmSrLnU9bBrRacAhoZf2pVZSJgNzf |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00373 DOGE, limit 0.0373 DOGE) |
+-----------------------------------------------------------------------------------------------------+
Wrote vault.json (transaction file version 2). Next: copy it to the signing machine and run "dogejs sign vault.json".
[exit 0]
$ dogejs multisig sign vault.json --key-file m1.txt --out vault.1.json
Transaction in vault.json (every figure below is computed from the transaction itself, not copied from the file text):
+- Signature to add ----------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (40.00 DOGE) |
| # DOGE From Status |
| - ----- ----------------------------------- ----------------------------------------------- |
| 1 40.00 2N58atBmSrLnU9bBrRacAhoZf2pVZSJgNzf unsigned: no key has signed yet (2 of 3 needed) |
| Total sent: 8.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 8.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00373 DOGE |
| Paid by: Inputs minus outputs: the fee is what the inputs hold beyond the outputs. Recipients |
| get exactly the amounts listed above. |
| Fee rate: 0.01 DOGE/kB effective on 373 bytes (asked for 0.01 DOGE/kB) |
| Change: 31.99627 DOGE to 2N58atBmSrLnU9bBrRacAhoZf2pVZSJgNzf |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00373 DOGE, limit 0.04764 DOGE) |
| Note in file: "Built by dogejs build 0.3.1. Fee mode: standard." (unverified text) |
+-----------------------------------------------------------------------------------------------------+
[!] partial. Wrote vault.1.json.
input 1: signed by key 3 of 3; 1 more needed
Pass the file to the next cosigner ("dogejs multisig sign"), or merge copies with "dogejs multisig combine".
[exit 0]
$ dogejs multisig sign vault.json --key-file m3.txt --out vault.3.json
Transaction in vault.json (every figure below is computed from the transaction itself, not copied from the file text):
+- Signature to add ----------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (40.00 DOGE) |
| # DOGE From Status |
| - ----- ----------------------------------- ----------------------------------------------- |
| 1 40.00 2N58atBmSrLnU9bBrRacAhoZf2pVZSJgNzf unsigned: no key has signed yet (2 of 3 needed) |
| Total sent: 8.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 8.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00373 DOGE |
| Paid by: Inputs minus outputs: the fee is what the inputs hold beyond the outputs. Recipients |
| get exactly the amounts listed above. |
| Fee rate: 0.01 DOGE/kB effective on 373 bytes (asked for 0.01 DOGE/kB) |
| Change: 31.99627 DOGE to 2N58atBmSrLnU9bBrRacAhoZf2pVZSJgNzf |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00373 DOGE, limit 0.04764 DOGE) |
| Note in file: "Built by dogejs build 0.3.1. Fee mode: standard." (unverified text) |
+-----------------------------------------------------------------------------------------------------+
[!] partial. Wrote vault.3.json.
input 1: signed by key 2 of 3; 1 more needed
Pass the file to the next cosigner ("dogejs multisig sign"), or merge copies with "dogejs multisig combine".
[exit 0]
$ dogejs multisig combine vault.1.json vault.3.json --out vault.signed.json
[ok] signed. Wrote vault.signed.json (txid 450b70bf8f40676f618629c1a4fd35599b2e4de15e3464f564941810b693f39c).
input 1: signed by keys 2 and 3 of 3; complete
[exit 0]
$ dogejs broadcast vault.signed.json --broadcast --esplora $INDEXER
Transaction 450b70bf8f40676f618629c1a4fd35599b2e4de15e3464f564941810b693f39c
+- Transaction to send -------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (40.00 DOGE) |
| Total sent: 8.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 8.00 nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv |
| Fee: 0.00373 DOGE |
| Paid by: Inputs minus outputs: the fee is what the inputs hold beyond the outputs. Recipients |
| get exactly the amounts listed above. |
| Fee rate: 0.01002688 DOGE/kB effective on 372 bytes (asked for 0.01 DOGE/kB) |
| Change: 31.99627 DOGE to 2N58atBmSrLnU9bBrRacAhoZf2pVZSJgNzf |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00372 DOGE, limit 0.04754 DOGE) |
| Note in file: "Built by dogejs build 0.3.1. Fee mode: standard." (unverified text) |
+-----------------------------------------------------------------------------------------------------+
[ok] sent. txid 450b70bf8f40676f618629c1a4fd35599b2e4de15e3464f564941810b693f39c
Follow it with: dogejs watch --txid 450b70bf8f40676f618629c1a4fd35599b2e4de15e3464f564941810b693f39c --network testnet --esplora URL
[exit 0]
PSBT for other wallets
Terminal
$ dogejs build --from nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub --to nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL:3 --esplora $INDEXER --out unsigned2.json
Reading unspent outputs and previous transactions from your backend...
+- Unsigned transaction ------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (87.4974 DOGE) |
| Total sent: 3.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 3.00 nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL |
| Fee: 0.00226 DOGE |
| Paid by: You pay it. It comes on top of the amounts, so every recipient gets the full amount. |
| Fee rate: 0.01 DOGE/kB effective on 226 bytes (asked for 0.01 DOGE/kB) |
| Change: 84.49514 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00226 DOGE, limit 0.0226 DOGE) |
+-----------------------------------------------------------------------------------------------------+
Wrote unsigned2.json (transaction file version 2). Next: copy it to the signing machine and run "dogejs sign unsigned2.json".
[exit 0]
$ dogejs psbt create unsigned2.json --out tx.psbt
Wrote tx.psbt: PSBT of unsigned transaction d67e32d8e6088396318774718f0e669072b4e8c0b043be7ad8c54347c1b5dfd8 on testnet.
[exit 0]
$ dogejs psbt inspect tx.psbt
PSBT version 0, 538 bytes, transaction d67e32d8e6088396318774718f0e669072b4e8c0b043be7ad8c54347c1b5dfd8
Network: testnet
Inputs:
1. e6b33586f40825e76ee1f39e3d4bd59c1900f3cda5907e60e1ccee68d5d7ee89:2 87.4974 DOGE nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub 0 of 1 signature(s)
Outputs:
1. nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL 3.00 DOGE
2. nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub 84.49514 DOGE (marked as change)
Fee: 0.00226 DOGE
Finalized: no
[exit 0]
$ dogejs psbt sign tx.psbt --key-file key.txt --out tx.signed.psbt
PSBT in tx.psbt (every figure below is computed from the transaction and the previous transactions inside the PSBT):
+- PSBT to sign --------------------------------------------------------------------------------------+
| Network: testnet |
| Inputs: 1 (87.4974 DOGE) |
| # DOGE From Status |
| - ------- ---------------------------------- -------- |
| 1 87.4974 nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub unsigned |
| Total sent: 3.00 DOGE in 1 output |
| # DOGE To |
| - ---- ---------------------------------- |
| 1 3.00 nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL |
| Fee: 0.00226 DOGE |
| Paid by: Inputs minus outputs: the fee is what the inputs hold beyond the outputs. Recipients |
| get exactly the amounts listed above. |
| Fee rate: 0.01 DOGE/kB effective on 226 bytes (asked for 0.01 DOGE/kB) |
| Change: 84.49514 DOGE to nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub |
| Standard: [ok] yes |
| Fee check: [ok] ok (expected about 0.00226 DOGE, limit 0.03294 DOGE) |
| Note in file: "Built by dogejs build 0.3.1. Fee mode: standard." (unverified text) |
+-----------------------------------------------------------------------------------------------------+
[ok] Added 1 signature. Wrote tx.signed.psbt.
Every input has enough signatures. Next: "dogejs psbt finalize tx.signed.psbt".
[exit 0]
$ dogejs psbt finalize tx.signed.psbt --out tx.final.psbt
[ok] Every input is final. Wrote tx.final.psbt. Next: "dogejs psbt extract tx.final.psbt".
[exit 0]
$ dogejs psbt extract tx.final.psbt --out tx.hex
Wrote tx.hex (transaction 38c14a02811ad9c84a02c4176e349b1ca5f1ad31f613b7cc68d9b09e86b56c37, 226 bytes, fee 0.00226 DOGE).
[exit 0]
$ dogejs broadcast tx.hex ...
(a DogeJS transaction file, not raw hex, goes to broadcast; the extracted hex goes to your node or indexer)
[exit 0]
$ dogejs decode tx.hex
txid: 38c14a02811ad9c84a02c4176e349b1ca5f1ad31f613b7cc68d9b09e86b56c37
network: testnet (addresses shown for this network)
version: 1 locktime: 0 size: 226 bytes
Inputs (1)
vin Outpoint scriptSig
--- ------------------------------------------------------------------ ---------
0 e6b33586f40825e76ee1f39e3d4bd59c1900f3cda5907e60e1ccee68d5d7ee89:2 107 bytes
Outputs (2)
vout DOGE To
---- -------- ----------------------------------
0 3.00 nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL
1 84.49514 nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub
fee: unknown (raw hex does not say what the inputs are worth)
standard: [ok] yes
checks: [ok] ok (CheckTransaction)
[exit 0]
Sign and verify a message
Terminal
$ dogejs message sign --key-file key.txt --message "I control this address"
Address: nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub
Signature: IDXuIT0MbtwIbleBOns5gU2riCO8EgPm9Y/WSDarcleVZvatYERGwwtitlNmNEgwLk+8muCSuZcqJP27DVSByW8=
[exit 0]
$ dogejs message verify --address nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub --signature $SIGNATURE --message "I control this address"
Signature is valid.
[exit 0]
$ dogejs message verify --address nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub --signature $SIGNATURE --message "I control this address!"
Signature is NOT valid for this address and message.
[exit 1]
Exit codes
Code
Meaning
0
OK
1
Failed: backend problem, invalid address or signature, rejected broadcast
$ dogejs address check nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Not valid: Base58Check checksum does not match.
[exit 1]
$ dogejs address check nsCyVMbwVcbNFQNHBmEtyUsx9YCzMC8mub
Valid P2PKH address.
Network: testnet
Hash160: fc7250a211deddc70ee5a2738de5f07817351cef
[exit 0]
$ dogejs build --to nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv
error: --to must look like ADDRESS:AMOUNT, for example nXXXX:12.5 (got "nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv").
[exit 2]
$ dogejs sign missing.json --key-file key.txt
error: Cannot read transaction file "missing.json" (ENOENT).
[exit 4]
$ dogejs payout --csv payouts.csv --key-file key.txt --network mainnet --esplora $INDEXER
error: The CSV has 2 problems. Nothing was done.
line 2: address is not a mainnet address
line 3: address is not a mainnet address
[exit 4]
$ dogejs balance DU9umLs2Ze8eNRo69wbSj5HeufphJawFPh --network mainnet --esplora $TESTNET_INDEXER
error: The server is on a different network than --network mainnet: esplora: expected mainnet but this backend serves testnet. Check the endpoint URL. Nothing was read or sent. Point --esplora / --rpc at a mainnet server, or change --network.
[exit 3]
$ dogejs sign junk.json --key-file key.txt
error: Invalid transaction file: "format" must be "dogejs-tx". This is not a DogeJS transaction file. (at /format) (at /format)
[exit 4]
$ dogejs watch nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL --esplora $INDEXER --amount 50 --timeout 3
Watching nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL on testnet for 50.00 DOGE with 1 confirmation...
Timed out before the payment was confirmed.
[exit 5]