DogeJS / All tools / Command line

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.

Node 20 or later. It starts on testnet, and does a dry run unless you add --broadcast.

A terminal: a new key, a payout CSV with two payments, and dogejs payout showing the payout plan as a dry run.

What it does

A terminal: dogejs key new, then dogejs build, writing an unsigned transaction and showing its summary.

Make keys and build on one machine

Keep the private key on an offline machine. Build an unsigned transaction where you can see the chain, and carry it over as a file.

  • The key goes to a file with restricted access, never to the screen
  • Reads unspent coins from your own indexer
  • A summary and the fee are shown before anything is signed
A terminal: dogejs psbt create, inspect and sign, with the summary of outputs and fee.

Share a PSBT with other wallets

Turn a transaction file into a PSBT and back, inspect it and sign it with the same rules as the sign command.

  • Inspect shows the outputs, change and fee
  • Previous transactions are required for signing
  • Base64 text, or hex with a flag
A terminal: dogejs multisig create with three public keys, then dogejs build from the descriptor, showing the unsigned transaction.

Multisig from the terminal

Create a 2-of-3 address from three public keys, then build a spend from it that each cosigner signs.

  • Every cosigner checks that the address matches
  • Reads coins and previous transactions from your backend
  • Nothing is sent unless you add --broadcast

Payouts, sweeps and offline signing from your terminal

Open source, MIT licensed, on GitHub.

For developers

Documentation

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

  1. Testnet and dry run

    The network is testnet unless you pass --network mainnet. Nothing is sent without --broadcast.

  2. 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.

  3. 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.

  4. 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.

Shell
dogejs build ... --out unsigned.json --psbt unsigned.psbt.txt   # or: dogejs psbt create unsigned.json
dogejs psbt inspect unsigned.psbt.txt                            # values, addresses, fee, signatures
dogejs psbt sign unsigned.psbt.txt --key-file key.txt --out signed.psbt.txt
dogejs psbt combine a.psbt.txt b.psbt.txt --out both.psbt.txt    # multisig copies
dogejs psbt finalize both.psbt.txt --out final.psbt.txt
dogejs psbt extract final.psbt.txt                               # prints the signed transaction hex
dogejs psbt convert final.psbt.txt --out signed.json             # a transaction file for "dogejs broadcast"

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.

CommandWhat it does
key newCreate a random key (WIF) or a seed phrase and save it to a file with mode 0600.
key addressShow addresses for a key, seed phrase, extended key or public key. Never prints secrets.
address checkCheck an address: checksum, type and network. Exit 0 if valid, 1 if not.
message signSign a message like Dogecoin Core signmessagewithprivkey. Prints the base64 signature.
message verifyVerify a signed message like Dogecoin Core verifymessage. Exit 0 if valid, 1 if not.
balanceShow confirmed and unconfirmed balance of addresses, from your own indexer.
utxosList the unspent outputs of addresses, from your own indexer.
buildBuild an UNSIGNED transaction file from your indexer data (run this on the online machine).
signSign a transaction file (run this on the offline machine). Reads keys from a file, the environment or a hidden prompt.
broadcastCheck a fully signed transaction file and, with --broadcast, send it through your own backend.
decodePretty-print a transaction: raw hex, a file containing hex, "-" for stdin, or a DogeJS transaction file.
sweepSend everything from one or more keys to one destination. The destination pays the fee. Dry run by default.
payoutPay many addresses from a CSV. Dry run by default; resumable without ever paying twice.
multisig createMake an m-of-n multisig: redeem script and P2SH address from public keys, saved to a descriptor file.
multisig signAdd one cosigner's signature to a transaction file. The file records which keys have signed.
multisig combineMerge the signatures from several copies of the same transaction file.
psbt create, psbt convertTurn a transaction file into a PSBT, or a PSBT back into a transaction file. Nothing is lost that both formats hold.
psbt inspectShow a PSBT's values, addresses, fee and signatures. No key needed.
psbt sign, psbt combine, psbt finalizeSign a PSBT (offline machine), merge copies signed by different cosigners, and build the final scripts.
psbt extractCheck a finalized PSBT and its fee, then print the signed transaction as hex.
watchWait for a payment to an address, or follow a payment you sent with --txid. Exits 0 when confirmed, 5 on timeout.

Flags

FlagWhat it does
--networktestnet (default), mainnet or regtest. Mainnet asks you to type send on mainnet after a summary.
--yes-mainnetFor scripts: skip the typed confirmation. The summary is still printed.
--broadcastSend. Without it, sweep, payout and broadcast are a dry run.
--key-file PATHRead the key or phrase from a file.
--key-env NAMERead it from the environment variable with this name.
--key-promptType or paste it at a hidden prompt.
--esplora URLYour own Esplora-style indexer. There is no default.
--rpc URLYour own Dogecoin Core node. Core has no address index.
--rpc-auth-env NAME, --rpc-auth-file PATHWhere to read user:password for --rpc.
--psbt PATHOn build, sign, multisig sign and multisig combine: also write the result as a PSBT. --hex on psbt commands writes hex instead of base64.
--out PATHOutput file. Existing files are kept unless you pass --force.
--fee-rate DOGE/kBThe fee rate, default 0.01. The fee guards of @dogejs/core always apply.
--subtract-feeTake the fee out of the amounts you typed. Recipients receive less.
--override-fee-guardAccept a fee that failed the fee check, after you checked it yourself.
--csv FILE, --report FILE, --resume REPORTPayout input, result report, and continuing an earlier payout.
--max-outputs NPay at most N addresses per transaction.
--gap NFor HD wallets, addresses to scan per chain. Default 20.
--jsonOne JSON object on stdout, errors included.
--no-color, --asciiTurn colour off, or use plain ASCII symbols and box lines.

Exit codes

CodeMeaning
0Success.
1Failed: backend problem, invalid address or signature, rejected broadcast.
2Usage error.
3Refused by a safety rule or fee guard.
4Invalid input file: CSV, transaction file, descriptor or plan.
5watch timed out.
6payout 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.

FieldWhat it holds
format, version"dogejs-tx" and 2.
networktestnet, mainnet or regtest.
stateunsigned, partial or signed. It must agree with the signatures.
unsignedTxHex 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.
summaryTotals, outputs, fee and fee rate, for people. It is checked against the transaction on read.
noteFree text. It is shown labelled unverified.
checksumSHA-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.

dogejs address check ADDRESS [--network NAME] [--json]

FlagValueWhat it does
--networkNAMERequire this network (mainnet, testnet or regtest). Without it any network is accepted and reported.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs balance9 options

Show confirmed and unconfirmed balance of addresses, from your own indexer.

dogejs balance ADDRESS... --esplora URL [--network NAME] [--json]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--esploraURLBase URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpcURLURL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-envNAMEName of an environment variable holding "user:password" for --rpc.
--rpc-auth-filePATHFile holding "user:password" for --rpc (permissions are checked).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs broadcast12 options

Check a fully signed transaction file and, with --broadcast, send it through your own backend.

dogejs broadcast FILE [--broadcast] (--esplora URL | --rpc URL) [--yes-mainnet]

FlagValueWhat it does
--esploraURLBase URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpcURLURL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-envNAMEName of an environment variable holding "user:password" for --rpc.
--rpc-auth-filePATHFile holding "user:password" for --rpc (permissions are checked).
--networkNAMERefuse unless the file is for this network (the network normally comes from the file).
--override-fee-guardDANGEROUS: 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.
--broadcastActually send it. Without this flag the command only checks the file and prints the summary (a dry run).
--yes-mainnetFor scripts: skip the typed mainnet confirmation (the network comes from the file).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs build19 options

Build an UNSIGNED transaction file from your indexer data (run this on the online machine).

dogejs build --from ADDRESS... --to ADDRESS:AMOUNT... --esplora URL [--change ADDRESS] [--subtract-fee] [--out FILE]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--yes-mainnetFor scripts: skip the typed mainnet confirmation. The summary is still printed.
--esploraURLBase URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpcURLURL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-envNAMEName of an environment variable holding "user:password" for --rpc.
--rpc-auth-filePATHFile holding "user:password" for --rpc (permissions are checked).
--fromADDRESSAddress to spend from (P2PKH, or the P2SH address of a --descriptor). Commas allowed. May be repeated.
--changeADDRESSChange address (default: the only --from address).
--descriptorPATHMultisig descriptor file for a P2SH --from address. May be repeated.
--allow-unconfirmedAlso spend unconfirmed outputs (default: confirmed only).
--subtract-feeTake 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-keysThe keys behind the P2PKH --from addresses are uncompressed (affects the size estimate only).
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--psbtPATHAlso write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs decode5 options

Pretty-print a transaction: raw hex, a file containing hex, "-" for stdin, or a DogeJS transaction file.

dogejs decode (HEX | FILE | -) [--network NAME] [--json]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs key address16 options

Show addresses for a key, seed phrase, extended key or public key. Never prints secrets.

dogejs key address (--key-file PATH | --key-env NAME | --key-prompt | --xpub XPUB | --pubkey HEX) [options]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--key-filePATHFile with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-envNAMEName of an environment variable that holds the same.
--key-promptType or paste the secret at a hidden prompt.
--passphrase-envNAMEEnvironment variable holding a BIP39 passphrase (seed phrases only).
--accountNHD account number (default 0).
--coin-typeNOverride the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--xpubXPUBAn extended PUBLIC key (not secret, so it may be on the command line).
--pubkeyHEXA public key in hex.
--pathPATHSeed/extended key: one absolute path such as m/44'/1'/0'/0/0 (replaces account, change, from and count).
--fromNFirst address index (default 0).
--countNHow many addresses (default 5).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs key new8 options

Create a random key (WIF) or a seed phrase and save it to a file with mode 0600.

dogejs key new [--seed-phrase] [--words 12|24] [--out PATH] [--force] [--network NAME] [--json]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--seed-phraseCreate a BIP39 seed phrase (24 words by default) instead of a single key.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs message sign14 options

Sign a message like Dogecoin Core signmessagewithprivkey. Prints the base64 signature.

dogejs message sign (--key-file PATH | --key-env NAME | --key-prompt) (--message TEXT | --message-file PATH) [options]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--key-filePATHFile with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-envNAMEName of an environment variable that holds the same.
--key-promptType or paste the secret at a hidden prompt.
--passphrase-envNAMEEnvironment variable holding a BIP39 passphrase (seed phrases only).
--accountNHD account number (default 0).
--coin-typeNOverride the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--indexNSeed phrase or extended key: sign with the key at m/44'/coin'/account'/0/N (default 0).
--messageTEXTThe message (UTF-8). Not a secret, so it may be on the command line.
--message-filePATHRead the message from a file (read exactly, trailing newline included).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs message verify9 options

Verify a signed message like Dogecoin Core verifymessage. Exit 0 if valid, 1 if not.

dogejs message verify --address ADDRESS --signature BASE64 (--message TEXT | --message-file PATH) [--network NAME]

FlagValueWhat it does
--networkNAMERequire this network. Without it the address network is detected.
--addressADDRESSThe P2PKH address that should have signed.
--signatureBASE64The signature (65 bytes, base64).
--messageTEXTThe message (UTF-8). Not a secret, so it may be on the command line.
--message-filePATHRead the message from a file (read exactly, trailing newline included).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs multisig combine9 options

Merge the signatures from several copies of the same transaction file.

dogejs multisig combine FILE FILE... [--out FILE]

FlagValueWhat it does
--networkNAMERefuse unless the file is for this network (the network normally comes from the file).
--override-fee-guardDANGEROUS: 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.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--psbtPATHAlso write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow 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.

dogejs multisig create --m N --pubkey HEX --pubkey HEX ... [--sort] [--out FILE] [--network NAME]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest.
--mNSignatures required.
--pubkeyHEXPublic key in hex (not secret). Commas allowed. Order matters unless --sort is given. May be repeated.
--sortSort the keys (BIP67 order) so every cosigner gets the same address whatever order they list them in.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs multisig sign17 options

Add one cosigner's signature to a transaction file. The file records which keys have signed.

dogejs multisig sign FILE (--key-file PATH | --key-env NAME | --key-prompt) [--out FILE]

FlagValueWhat it does
--yes-mainnetFor scripts: skip the typed mainnet confirmation (the network comes from the file).
--networkNAMERefuse unless the file is for this network (the network normally comes from the file).
--override-fee-guardDANGEROUS: 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-filePATHFile with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-envNAMEName of an environment variable that holds the same.
--key-promptType or paste the secret at a hidden prompt.
--passphrase-envNAMEEnvironment variable holding a BIP39 passphrase (seed phrases only).
--accountNHD account number (default 0).
--coin-typeNOverride the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gapNHD wallets: addresses to scan per chain (external and change), default 20.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--psbtPATHAlso write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs payout27 options

Pay many addresses from a CSV. Dry run by default; resumable without ever paying twice.

dogejs payout --csv FILE (--key-file PATH | ...) --esplora URL [--broadcast] [--report FILE]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--yes-mainnetFor scripts: skip the typed mainnet confirmation. The summary is still printed.
--esploraURLBase URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpcURLURL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-envNAMEName of an environment variable holding "user:password" for --rpc.
--rpc-auth-filePATHFile holding "user:password" for --rpc (permissions are checked).
--key-filePATHFile with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-envNAMEName of an environment variable that holds the same.
--key-promptType or paste the secret at a hidden prompt.
--passphrase-envNAMEEnvironment variable holding a BIP39 passphrase (seed phrases only).
--accountNHD account number (default 0).
--coin-typeNOverride the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gapNHD wallets: addresses to scan per chain (external and change), default 20.
--allow-unconfirmedAlso spend unconfirmed outputs (default: confirmed only).
--csvFILEPayments: header "address,amount" or "address,amount,label". Amounts are decimal DOGE strings.
--reportFILEResult report CSV to create (default: timestamped). The plan goes to FILE.plan.json. Existing files are never overwritten.
--resumeREPORTContinue a payout from its report. Re-sends only the transactions already signed in the plan.
--allow-duplicatesAllow the same address on several rows (default: refuse).
--max-outputsNPay at most N addresses per transaction (default: as many as a standard transaction allows).
--changeADDRESSWhere change goes (default: the first address of your key).
--subtract-feeTake 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-guardDANGEROUS: 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.
--broadcastSend the transactions. Without it nothing is sent: you get the summary, the signed plan and the report.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs psbt combine7 options

Merge several PSBTs of the same transaction (for example copies signed by different cosigners).

dogejs psbt combine FILE FILE... [--out FILE] [--hex]

FlagValueWhat it does
--hexWrite the PSBT as hex instead of base64.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs psbt convert8 options

Convert between a PSBT and a DogeJS transaction file, either way (the direction comes from the input).

dogejs psbt convert FILE [--network NAME] [--out FILE] [--hex]

FlagValueWhat it does
--networkNAMERefuse unless the file is for this network (the network normally comes from the file).
--hexWrite the PSBT as hex instead of base64.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs psbt create9 options

Turn a DogeJS transaction file into a PSBT (BIP174) for other wallets and hardware-wallet tools.

dogejs psbt create FILE [--descriptor FILE ...] [--out FILE] [--hex]

FlagValueWhat it does
--networkNAMERefuse unless the file is for this network (the network normally comes from the file).
--descriptorFILEMultisig descriptor: its redeem script is added to the inputs and outputs (change) that use its address. May be repeated.
--hexWrite the PSBT as hex instead of base64.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs psbt extract9 options

Get the signed network transaction (hex) out of a finalized PSBT, after checking it and its fee.

dogejs psbt extract FILE [--network NAME] [--out FILE] [--json]

FlagValueWhat it does
--networkNAMEThe network, when the PSBT does not say (it must agree if it does).
--override-fee-guardDANGEROUS: 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.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow 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]

FlagValueWhat it does
--hexWrite the PSBT as hex instead of base64.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs psbt inspect6 options

Show what a PSBT does: inputs and their values, outputs and addresses, fee, signatures. No key needed.

dogejs psbt inspect FILE [--network NAME] [--json]

FlagValueWhat it does
--networkNAMENetwork for the addresses, when the PSBT does not say (it must agree if it does).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs psbt sign17 options

Sign a PSBT (run this on the offline machine). The fee is checked and the summary shown before any key is read.

dogejs psbt sign FILE (--key-file PATH | --key-env NAME | --key-prompt) [--out FILE] [--network NAME] [--yes-mainnet]

FlagValueWhat it does
--yes-mainnetFor scripts: skip the typed mainnet confirmation.
--networkNAMEThe network, when the PSBT does not say (it must agree if it does).
--override-fee-guardDANGEROUS: 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-filePATHFile with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-envNAMEName of an environment variable that holds the same.
--key-promptType or paste the secret at a hidden prompt.
--passphrase-envNAMEEnvironment variable holding a BIP39 passphrase (seed phrases only).
--accountNHD account number (default 0).
--coin-typeNOverride the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gapNHD wallets: addresses to scan per chain (external and change), default 20.
--hexWrite the PSBT as hex instead of base64.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow 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.

dogejs sign FILE (--key-file PATH | --key-env NAME | --key-prompt) [--out FILE] [--yes-mainnet]

FlagValueWhat it does
--yes-mainnetFor scripts: skip the typed mainnet confirmation (the network comes from the file).
--networkNAMERefuse unless the file is for this network (the network normally comes from the file).
--override-fee-guardDANGEROUS: 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-filePATHFile with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-envNAMEName of an environment variable that holds the same.
--key-promptType or paste the secret at a hidden prompt.
--passphrase-envNAMEEnvironment variable holding a BIP39 passphrase (seed phrases only).
--accountNHD account number (default 0).
--coin-typeNOverride the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gapNHD wallets: addresses to scan per chain (external and change), default 20.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--psbtPATHAlso write the result as a PSBT (BIP174, base64) to PATH, for other wallets and hardware-wallet tools.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs sweep23 options

Send everything from one or more keys to one destination. The destination pays the fee. Dry run by default.

dogejs sweep --to ADDRESS (--key-file PATH | --key-env NAME | --key-prompt) --esplora URL [--broadcast] [--out FILE]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--yes-mainnetFor scripts: skip the typed mainnet confirmation. The summary is still printed.
--esploraURLBase URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpcURLURL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-envNAMEName of an environment variable holding "user:password" for --rpc.
--rpc-auth-filePATHFile holding "user:password" for --rpc (permissions are checked).
--key-filePATHFile with a WIF (one per line), a seed phrase or an extended private key. Keep it mode 0600.
--key-envNAMEName of an environment variable that holds the same.
--key-promptType or paste the secret at a hidden prompt.
--passphrase-envNAMEEnvironment variable holding a BIP39 passphrase (seed phrases only).
--accountNHD account number (default 0).
--coin-typeNOverride the BIP44 coin type (default 3 on mainnet, 1 on testnet and regtest).
--gapNHD wallets: addresses to scan per chain (external and change), default 20.
--allow-unconfirmedAlso spend unconfirmed outputs (default: confirmed only).
--toADDRESSDestination address.
--max-inputsNSpend at most N outputs per transaction (default: as many as fit in a standard transaction).
--broadcastSend the signed transactions. Without it they are only written to files.
--outPATHOutput file (default: a timestamped name in the current directory).
--forceOverwrite an existing output file. Without it, existing files are never touched.
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs utxos9 options

List the unspent outputs of addresses, from your own indexer.

dogejs utxos ADDRESS... --esplora URL [--network NAME] [--json]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--esploraURLBase URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpcURLURL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-envNAMEName of an environment variable holding "user:password" for --rpc.
--rpc-auth-filePATHFile holding "user:password" for --rpc (permissions are checked).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow this help.
dogejs watch14 options

Wait for a payment to an address, or follow a payment you sent (--txid). Exits 0 when confirmed, 5 on timeout.

dogejs watch ADDRESS --esplora URL [--amount DOGE] [--confirmations N] [--timeout SECONDS]

FlagValueWhat it does
--networkNAMEtestnet (default), mainnet or regtest. Mainnet needs this flag explicitly.
--esploraURLBase URL of your own Esplora-style indexer (for example electrs-doge). There is no default.
--rpcURLURL of your own Dogecoin Core node. There is no default. Core has no address index.
--rpc-auth-envNAMEName of an environment variable holding "user:password" for --rpc.
--rpc-auth-filePATHFile holding "user:password" for --rpc (permissions are checked).
--txidTXIDFollow one transaction you sent (for example after "dogejs broadcast") instead of waiting for a payment to an address.
--amountDOGEAddress mode: total to wait for, summed over payments (default: any amount, at least 1 koinu).
--confirmationsNConfirmations needed (default 1).
--timeoutSECONDSGive up after this long (exit 5). Default: wait until you stop it.
--pollSECONDSSeconds between checks (default 15).
--jsonMachine-readable JSON on stdout (errors too). Warnings stay on stderr.
--no-colorNo colour. Colour is also off when NO_COLOR is set, when output is piped, or when TERM is "dumb".
--asciiPlain ASCII symbols and box lines (the default whenever output is piped).
--helpShow 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.

CSV
address,amount,label
nqnpdodJAV4gmyWQtMGfazwd5wV5xguuHv,10,Alice
nbmQN6E5YboY9W3cV3X34GZekVjnBHceJL,2.5,Bob

See dogejs payout above for the flags.

Run transcripts

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

CodeMeaning
0OK
1Failed: backend problem, invalid address or signature, rejected broadcast
2Usage error
3Refused by a safety rule or fee guard
4Invalid input file (CSV, transaction file, descriptor, plan)
5watch timed out
6payout finished with unpaid rows

Transcript of real runs:

Terminal
$ 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]

Self-hosting and source

Source: github.com/DogeJS-Dev/cli (package @dogejs/cli).

Shell
git clone https://github.com/DogeJS-Dev/cli
cd cli
npm install
npm run build
npm test

FAQ

Is it testnet by default?

Yes. Mainnet needs --network mainnet explicitly and a typed confirmation (or --yes-mainnet in scripts).

Where do keys come from?

From files (--key-file), never from the command line, so they stay out of shell history.

Which indexer?

Your own Esplora-style indexer (--esplora) or Dogecoin Core (--rpc). There is no default.

Can I sign on an offline machine?

Yes: build stores previous transactions in the file so sign needs no network.