Transaction Schema

Transaction

A transaction represents the creation or transfer of assets in BigchainDB.

Transaction.id

type: string

A sha3 digest of the transaction. The ID is calculated by removing all derived hashes and signatures from the transaction, serializing it to JSON with keys in sorted order and then hashing the resulting string with sha3.

Transaction.operation

type: string

Type of the transaction:

A CREATE transaction creates an asset in BigchainDB. This transaction has outputs but no inputs, so a dummy input is created.

A TRANSFER transaction transfers ownership of an asset, by providing an input that meets the conditions of an earlier transaction’s outputs.

A GENESIS transaction is a special case transaction used as the sole member of the first block in a BigchainDB ledger.

Transaction.asset

type: object

Description of the asset being transacted.

See: Asset.

Transaction.inputs

type: array (object)

Array of the inputs of a transaction.

See: Input.

Transaction.outputs

type: array (object)

Array of outputs provided by this transaction.

See: Output.

Transaction.metadata

type: object or null

User provided transaction metadata. This field may be null or may contain an id and an object with freeform metadata.

See: Metadata.

Transaction.version

type: string

BigchainDB transaction schema version.

Input

An input spends a previous output, by providing one or more fulfillments that fulfill the conditions of the previous output.

Input.owners_before

type: array (string) or null

List of public keys of the previous owners of the asset.

Input.fulfillment

type: string or object or object

Fulfillment of an Output.condition, or, put a different way, a payload that satisfies the condition of a previous output to prove that the creator(s) of this transaction have control over the listed asset.

Input.fulfills

type: object or null

Reference to the output that is being spent.

Output

A transaction output. Describes the quantity of an asset and the requirements that must be met to spend the output.

See also: Input.

Output.amount

type: string

Integral amount of the asset represented by this output. In the case of a non divisible asset, this will always be 1.

Output.condition

type: object

Describes the condition that needs to be met to spend the output. Has the properties:

  • details: Details of the condition.
  • uri: Condition encoded as an ASCII string.

Output.public_keys

type: array (string) or null

List of public keys associated with the conditions on an output.

Asset

Description of the asset being transacted. In the case of a TRANSFER transaction, this field contains only the ID of asset. In the case of a CREATE transaction, this field contains only the user-defined payload.

Asset.id

type: string

ID of the transaction that created the asset.

Asset.data

type: object or null

User provided metadata associated with the asset. May also be null.

Metadata

User provided transaction metadata. This field may be null or may contain an non empty object with freeform metadata.