Sigindex

From Veriblock Wiki
Revision as of 14:58, 28 September 2021 by VeriBlockTim (talk | contribs) (Created page with "See: NodeCore_CommandLine == Overview == The signature index increments for each new transaction from an address. It is needed especially if signing a transaction and t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

See: NodeCore_CommandLine

Overview

The signature index increments for each new transaction from an address.

It is needed especially if signing a transaction and then submitting to the network (which some exchanges and wallets will do).

It never resets.

Mempool sigindex should be the same as blockchain sigindex if there are no pending transactions.

So if it's a new address, blockchain index will be -1, mempool index will be -1.

Sigindex value is:

  • -1 for new address
  • 0 for 1st tx sent
  • 1 for 2nd tx sent
  • etc...

API

You can get sigindex from the API or Commandline.

See: NodeCore_CommandLine#sigindex shows the sigindex

Or curl from the command line (see: NodeCore_HTTP_API#Making_a_Request_with_curl) :

curl -H "Content-Type: application/json" --data '{"jsonrpc": "2.0","method": "getsignatureindex","params": {"addresses": ["VDzUyMWrAc24Yk1bqfXeU576J5E44k"]},"id": 123}' http://127.0.0.1:10600/api

Sample result:

{
  "jsonrpc": "2.0",
  "result": {
    "indexes": [
      {
        "address": "VDzUyMWrAc24Yk1bqfXeU576J5E44k",
        "poolIndex": "11",
        "blockchainIndex": "11"
      }
    ],
    "success": true
  },
  "id": 123
}

Here is a JS example to sign and submit a tx with sigindex:

https://github.com/VeriBlock/nodecore-js/tree/master/packages/core#examples

Mempool

poolIndex = before the transaction is broadcast - it is still in the mempool.

blockchainIndex = once the transaction is broadcast.