We put our best effort into covering all topics related to Dimecoin. Each section will cover a different category. Not all documentation may be 100% accurate, if you spot an error, please report it or submit a PR request on GitHub.

REMINDER: This documentation is always evolving. If you have not been here for a while, perhaps check again. Things may have been added or updated since your last visit!

Mining RPCs#

GetBlockTemplate#

The getblocktemplate RPC gets a block template or proposal for use with mining software. For more information, please see the following resources:

Parameter #1—a JSON request object

Name

Type

Presence

Description

Request

object

Optional
(exactly 1)

A JSON request object


mode

string

Optional
(exactly 1)

This must be set to \template” or omitted”


capabilities

array (string)

Optional
(0 or more)

A list of strings

→ →
Capability

string

Optional
(exactly 1)

Client side supported feature, longpoll, coinbasetxn, coinbasevalue, proposal, serverlist, workid


rules

array (string)

Optional
(0 or more)

A list of strings

→ →
Rules

string

Optional
(exactly 1)

Client side supported softfork deployment, csv, dip0001, etc.

Result—block template

Name

Type

Presence

Description

result

object

Required
(exactly 1)

A object containing a block template


capabilities

array (string)

Required
(1 or more)

The client side supported features

→ →
Capability

string

Optional
(0 or more)

A client side supported feature


version

number (int)

Required
(exactly 1)

The block version


rules

array (string)

Required
(1 or more)

The specific block rules that are to be enforced

→ →
Block Rule

string

Optional
(0 or more)

A specific block rule to be enforced


vbavailable

object

Required
(exactly 1)

Contains the set of pending, supported versionbit (BIP 9) softfork deployments

→ →
Bit Number

number

Required
(0 or more)

The bit number the named softfork rule


vbrequired

number

Required
(exactly 1)

The bit mask of versionbits the server requires set in submissions


previousblockhash

string (hex)

Required
(exactly 1)

The hash of current highest block


transactions

array (objects)

Optional
(0 or more)

Non-coinbase transactions to be included in the next block

→ →
Transaction

object

Optional
(0 or more)

Non-coinbase transaction

→ → →
data

string (hex)

Optional
(0 or more)

Transaction data encoded in hex (byte-for-byte)

→ → →
hash

string (hex)

Optional
(0 or more)

The hash/id encoded in little-endian hex

→ → →
depends

array (numbers)

Required
(0 or more)

An array holding TXIDs of unconfirmed transactions this TX depends upon (parent transactions).

→ → → →
Transaction number

number

Optional
(1 or more)

Transactions before this one (by 1-based index in transactions list) that must be present in the final block if this one is

→ → →
fee

number

Required
(exactly 1)

The difference in value between transaction inputs and outputs (in dimecoins). For coinbase transactions, this is a negative number of the total collected block fees (ie., not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn’t one

→ → →
sigops

number

Required
(exactly 1)

Total SigOps. If not present, the count is unknown (clients MUST NOT assume there aren’t any)


coinbaseaux

object

Required
(exactly 1)

A object containing data that should be included in the coinbase scriptSig content


coinbasevalue

number

Required
(exactly 1)

The maximum allowable input to coinbase transaction, including the generation award and transaction fees (in dimecoins)


longpollid

number

Required
(exactly1)

Version identifier that represents the current state of the blockchain as seen by the node.


target

string

Required
(exactly 1)

The hash target


mintime

number

Required
(exactly 1)

The minimum timestamp appropriate for next block time in seconds since epoch


mutable

array (string)

Required
(exactly 1)

The list of ways the block template may be changed

→ →
Value

string

Required
(0 or more)

A way the block template may be changed, e.g. ‘time’, ‘transactions’, ‘prevblock’


noncerange

string

Required
(exactly 1)

A range of valid nonces


sigoplimit

number

Required
(exactly 1)

The limit of sigops in blocks


sizelimit

number

Required
(exactly 1)

The limit of block size


curtime

number

Required
(exactly 1)

The current timestamp in seconds since epoch


bits

string

Required
(exactly 1)

The compressed target of next block


previousbits

string

Required
(exactly 1)

The compressed target of the current highest block


height

number

Required
(exactly 1)

The height of the next block


masternode

array (objects)

Required
(0 or more)

Required masternode payments that must be included in the next block

→ →
Masternode Payee

object

Optional
(0 or more)

Object containing a masternode payee’s information

→ → →
payee

string

Required
(exactly 1)

Payee address

→ → →
script

string

Required
(exactly 1)

Payee scriptPubKey

→ → →
amount

number

Required
(exactly 1)

Required amount to pay


masternode_payments_started

boolean

Required
(exactly 1)

True if masternode payments started


masternode_payments_enforced

boolean

Required
(exactly 1)

True if masternode payments enforced

Example from Dimecoin Core 2.3.0.0

dimecoin-cli -mainnet getblocktemplate

Result:

{
  "capabilities": [
    "proposal"
  ],
  "version": 536870912,
  "rules": [
  ],
  "vbavailable": {
  },
  "vbrequired": 0,
  "previousblockhash": "00000000000a042c4806b6cae473b2c07afcf572b5906b2911c9deb6ae95fb3c",
  "transactions": [
  ],
  "coinbaseaux": {
    "flags": ""
  },
  "coinbasevalue": 1355700000,
  "longpollid": "00000000000a042c4806b6cae473b2c07afcf572b5906b2911c9deb6ae95fb3c5782997",
  "target": "00000000000f3f86000000000000000000000000000000000000000000000000",
  "mintime": 1709932218,
  "mutable": [
    "time",
    "transactions",
    "prevblock"
  ],
  "noncerange": "00000000ffffffff",
  "sigoplimit": 20000,
  "sizelimit": 1000000,
  "curtime": 1709932679,
  "bits": "1b0f3f86",
  "height": 5782847,
  "masternode": [
    {
      "payee": "7BBVpSS7roduwe2ruiRLS1MGHG51ePikpu",
      "script": "76a91458f93f060d23eca36d8a5b30a3961d7262fc16e088ac",
      "amount": 610065000
    }
  ],
  "masternode_payments_started": false,
  "masternode_payments_enforced": false
}

See also

  • GetMiningInfo: returns various mining-related information.

  • SubmitBlock: accepts a block, verifies it is a valid addition to the blockchain, and broadcasts it to the network. Extra parameters are ignored by Dimecoin Core but may be used by mining pools or other programs.

  • PrioritiseTransaction: adds virtual priority or fee to a transaction, allowing it to be accepted into blocks mined by this node (or miners which use this node) with a lower priority or fee. (It can also remove virtual priority or fee, requiring the transaction have a higher priority or fee to be accepted into a locally-mined block.)

GetMiningInfo#

The getmininginfo RPC returns various mining-related information.

Parameters: none

Result—various mining-related information

Name

Type

Presence

Description

result

object

Required
(exactly 1)

Various mining-related information


blocks

number (int)

Required
(exactly 1)

The height of the highest block on the local best blockchain


currentblocksize

number (int)

Optional
(0 or 1)

If generation was enabled since the last time this node was restarted, this is the size in bytes of the last block built by this node for header hash checking.


currentblocktx

number (int)

Optional
(0 or 1)

If generation was enabled since the last time this node was restarted, this is the number of transactions in the last block built by this node for header hash checking.


difficulty

number (real)

Required
(exactly 1)

If generation was enabled since the last time this node was restarted, this is the difficulty of the highest-height block in the local best blockchain. Otherwise, this is the value 0


networkhashps

number (int)

Required
(exactly 1)

An estimate of the number of hashes per second the network is generating to maintain the current difficulty. See the getnetworkhashps RPC for configurable access to this data


pooledtx

number (int)

Required
(exactly 1)

The number of transactions in the memory pool


chain

string

Required
(exactly 1)

Set to main for mainnet, test for testnet, and regtest for regtest


warnings

string

Required
(exactly 1)

Any network or blockchain warnings


errors

string

Optional
(0 or 1)

Only shown when dimecoind is started with getmininginfo

Example from Dimecoin Core 2.3.0.0

dimecoin-cli getmininginfo

Result:

{
  "blocks": 5782848,
  "currentblockweight": 4000,
  "currentblocktx": 0,
  "difficulty": {
    "proof-of-work": 3234.210187053827,
    "proof-of-stake": 201952203.5483864
  },
  "networkhashps": 435726190377064.9,
  "pooledtx": 0,
  "chain": "main",
  "warnings": ""
}

See also

  • GetMemPoolInfo: returns information about the node’s current transaction memory pool.

  • GetRawMemPool: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.

  • GetBlockTemplate: gets a block template or proposal for use with mining software.

GetNetworkHashPS#

The getnetworkhashps RPC returns the estimated network hashes per second based on the last n blocks.

Parameter #1—number of blocks to average

Name

Type

Presence

Description

blocks

number (int)

Optional
(0 or 1)

The number of blocks to average together for calculating the estimated hashes per second. Default is 120. Use -1 to average all blocks produced since the last difficulty change

Parameter #2—block height

Name

Type

Presence

Description

height

number (int)

Optional
(0 or 1)

The height of the last block to use for calculating the average. Defaults to -1 for the highest-height block on the local best blockchain. If the specified height is higher than the highest block on the local best blockchain, it will be interpreted the same as -1

Result—estimated hashes per second

Name

Type

Presence

Description

result

number (int)

Required
(exactly 1)

The estimated number of hashes per second based on the parameters provided. May be 0 (for Height=0, the genesis block) or a negative value if the highest-height block averaged has a block header time earlier than the lowest-height block averaged

Example from Dimecoin Core 2.3.0.0

Get the average hashes per second for all the blocks since the last difficulty change before block 4000.

dimecoin-cli -mainnet getnetworkhashps -1 4000

Result:

938189.1678726483

See also

  • GetDifficulty: returns the proof-of-work and proof-of-stake difficulties as a multiple of the minimum difficulty.

  • GetBlock: gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

PrioritiseTransaction#

The prioritisetransaction RPC adds virtual priority or fee to a transaction, allowing it to be accepted into blocks mined by this node (or miners which use this node) with a lower priority or fee. (It can also remove virtual priority or fee, requiring the transaction have a higher priority or fee to be accepted into a locally-mined block.)

Parameter #1—the TXID of the transaction to modify

Name

Type

Presence

Description

TXID

string

Required
(exactly 1)

The TXID of the transaction whose virtual priority or fee you want to modify, encoded as hex in RPC byte order

Parameter #2—the change to make to the virtual fee

Name

Type

Presence

Description

Fee

number (int)

Required
(exactly 1)

Warning: this value is in mDIME, not DIME

If positive, the virtual fee to add to the actual fee paid by the transaction; if negative, the virtual fee to subtract from the actual fee paid by the transaction. No change is made to the actual fee paid by the transaction

Result—true if the priority is changed

Name

Type

Presence

Description

result

bool (true only)

Required
(exactly 1)

Always set to true if all three parameters are provided. Will not return an error if the TXID is not in the memory pool. If fewer or more than three arguments are provided, or if something goes wrong, will be set to null

See also

  • GetRawMemPool: returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.

  • GetBlockTemplate: gets a block template or proposal for use with mining software.

SubmitBlock#

The submitblock RPC accepts a block, verifies it is a valid addition to the blockchain, and broadcasts it to the network. Extra parameters are ignored by Dimecoin Core but may be used by mining pools or other programs.

Parameter #1—the new block in serialized block format as hex

Name

Type

Presence

Description

Block

string (hex)

Required
(exactly 1)

The full block to submit in serialized block format as hex

Parameter #2—dummy value

Name

Type

Presence

Description

dummy

object

Optional
(0 or 1)

A dummy value for compatibility with BIP22. This value is ignored.

Result—null or error string

Name

Type

Presence

Description

result

null/string

Required
(exactly 1)

If the block submission succeeded, set to JSON null. If submission failed, set to one of the following strings: duplicate, duplicate-invalid, inconclusive, or rejected. The JSON-RPC error field will still be set to null if submission failed for one of these reasons

Example from Dimecoin Core 2.3.0.0

Submit the following block with the a dummy value, “test”.

dimecoin-cli -mainnet submitblock 01000000010000000000000000000000000000000000000\
000000000000000000000000000ffffffff2103423d58047a81eb650881008e81806400005468\
65426565506f6f6c2e636f6d00000000000208ddce00000000001976a914b153550dd81025c35\
42d95d0a744ccb2408d809488ac187aff4f000000001976a91446cb8dd813962ea615d115a445\
5d23179fe7c80688ac00000000\
  "test"

Result (the block above was already on a copy of the local chain):

duplicate

See also

  • GetBlockTemplate: gets a block template or proposal for use with mining software.