v1

latestOpenAPI 3.0.02026-07-17151326.9 KB
Anchor

Get first valid Sidetree transaction

Given a list of Sidetree transactions, returns the first transaction in the list that is valid. Returns 404 NOT FOUND if none of the given transactions are valid. This API is primarily used by the Sidetree core library to determine a transaction that can be used as a marker in time to reprocess transactions in the event of a block reorganization (temporary fork).

post/anchor/transactions/first-valid

Request body

transaction_numbernumber

A monotonically increasing number (need NOT be by 1) that identifies a Sidtree transaction.

transaction_timenumber

The logical anchor time this transaction is anchored. Used for protocol version selection.

transaction_time_hashstring

The hash associated with the transaction time.

anchor_stringstring

The string written to the anchor for this transaction.

transaction_fee_paidstring

A number representing the fee paid for this transaction.

normalized_transaction_feestring

A number representing the normalized transaction fee used for proof-of-fee calculation.

writerstring

A string representing the writer of the transaction. Used in the value time lock calculations.

Example request

[
  {
    "transaction_number": 19,
    "transaction_time": 545236,
    "transaction_time_hash": "0000000000000000002352597f8ec45c56ad19994808e982f5868c5ff6cfef2e",
    "anchor_string": "Qm28BKV9iiM1ZNzMsi3HbDRHDPK5U2DEhKpCYhKk83UPEg",
    "transaction_fee_paid": 5000,
    "normalized_transaction_fee": 100,
    "writer": "0af7eccefa3aaa37421914923b4a2034ed5a0ad0"
  },
  {
    "transaction_number": 18,
    "transaction_time": 545236,
    "transaction_time_hash": "0000000000000000000054f9719ef6ca646e2503a9c5caac1c6ea95ffb4af587",
    "anchor_string": "Qmb2wxUwvEpspKXU4QNxwYQLGS2gfsAuAE9LPcn5LprS1nb",
    "transaction_fee_paid": 30,
    "normalized_transaction_fee": 10,
    "writer": "0af7eccefa3aaa37421782523b4a2034ed5a0ad0"
  },
  {
    "transaction_number": 16,
    "transaction_time": 545200,
    "transaction_time_hash": "0000000000000000000f32c84291a3305ad9e5e162d8cc363420831ecd0e2800",
    "anchor_string": "QmbBPdjWSdJoQGHbZDvPqHxWqqeKUdzBwMTMjJGeWyUkEzK",
    "transaction_fee_paid": 50000,
    "normalized_transaction_fee": 150,
    "writer": "0af7eccefa3aaa87421782523b4a2034ed5a0ad0"
  }
]

Response

Success

transaction_numbernumber

A monotonically increasing number (need NOT be by 1) that identifies a Sidtree transaction.

transaction_timenumber

The logical anchor time this transaction is anchored. Used for protocol version selection.

transaction_time_hashstring

The hash associated with the transaction time.

anchor_stringstring

The string written to the anchor for this transaction.

transaction_fee_paidstring

A number representing the fee paid for this transaction.

normalized_transaction_feestring

A number representing the normalized transaction fee used for proof-of-fee calculation.

writerstring

A string representing the writer of the transaction. Used in the value time lock calculations.

Example response

{
  "transaction_number": 89,
  "transaction_time": 545236,
  "transaction_time_hash": "0000000000000000002352597f8ec45c56ad19994808e982f5868c5ff6cfef2e",
  "anchor_string": "QmWd5PH6vyRH5kMdzZRPBnf952dbR4av3Bd7B2wBqMaAcf",
  "transaction_fee_paid": 40000,
  "normalized_transaction_fee": 100,
  "writer": "0af7eccefa3aaa37421914923b4a2034ed5a0ad0"
}