Transaction
JSON Model
NOTE: This is the base json model in the BRS Transaction class. The API contains additional fields that will be discussed on the API page.
- Type
- Key:
type
- Value Datatype:
number
(byte
encoded as a number)
- Key:
- Sub Type
- Key:
subtype
- Value Datatype:
number
(byte
encoded as a number)
- Key:
- Timestamp
- Key:
timestamp
- Value Datatype:
number
- Key:
- Deadline
- Key:
deadline
- Value Datatype:
number
- Key:
- Sender Public Key
- Key:
senderPublicKey
- Value Datatype:
string
(Hex encoded bytes)
- Key:
- Recipient
- Key:
recipient
- Value Datatype:
string
(Unsigned 64 bit integer
asString
)
- Key:
- Amount in NQT
- Key:
amountNQT
- Value Datatype:
number
- Key:
- Fees Amount in NQT
- Key:
feeNQT
- Value Datatype:
number
- Key:
- Referenced Transaction Full Hash
- Key:
referencedTransactionFullHash
- Value Datatype:
string
- TODO: Figure out if this should be byte array maybe
- Key:
- ecBlockHeight
- Key:
ecBlockHeight
- Value Datatype:
number
- Key:
- ecBlockId
- Key:
ecBlockId
- Value Datatype:
string
(Unsigned 64 bit integer
asString
)
- Key:
- Signature
- Key:
signature
- Value Datatype:
string
(Hex encoded bytes)
- Key:
- Attachment
- Key:
attachment
- Value Datatype:
array of object
(JSON object array)
- Key:
- Version
- Key:
version
- Value Datatype:
number
- Key:
Structure of Bytes Representation
-
Transaction Type
- Datatype:
Byte
- The type of transaction. (See Transaction Types and Subtypes section)
- Datatype:
-
Transaction Subtype
- Datatype:
byte
- The subtype of the transaction. (See Transaction Types and Subtypes section)
- Datatype:
-
Timestamp
- Datatype:
Signed 32 bit integer
- The time of the transaction in
since the beginning of the chain. - TODO: LIST TIMEZONE, PROBABLY UTC
- Datatype:
-
Deadline
- Datatype:
Signed 16 bit integer
- The deadline to forge a block including this transaction. It will be lost if this passes.
- Datatype:
-
Signature
- Datatype:
32 raw bytes
- This depends on the block's height and when a certain update was released at block 255000.
- If it is signed, append the public key of the sender.
- If not signed but before AT_FIX_BLOCK_4 upgrade, append the sender's public key.
- If not signed but after the AT_FIX_BLOCK_4 upgrade, append a
Signed 64 bit integer
that is the sender's account ID, followed by 24 empty bytes (all zeros).
- TODO: Define AT_FIX_BLOCK_4 better
- Datatype:
-
Recipient
- Datatype:
Signed 64 bit integer
- Depends on whether the transaction has a specified single recipient.
- If a recipient exists, include the recipient's ID.
- If no recipient exists, include the 'Zero' account. The value should just be
0
.
- Datatype:
-
Amount of Signa being Sent in this Transaction
- This field depends on the height of the block for both datatype and value.
- Block height >= Constants.NQT_BLOCK (
0
for Signum)- Datatype:
Signed 64 bit integer
- Amount in NQT.
- Datatype:
- Block height < Constants.NQT_BLOCK
- Datatype:
Signed 32 bit integer
- Amount in NQT divided by One Signa in NQT (100,000,000).
- Datatype:
- TODO: Remove the conditional if https://github.com/signum-network/signum-node/pull/596 is merged
-
Amount of Fees for this Transaction
- This field depends on the height of the block for both datatype and value.
- Block height >= Constants.NQT_BLOCK (
0
for Signum)- Datatype:
Signed 64 bit integer
- Amount in NQT.
- Datatype:
- Block height < Constants.NQT_BLOCK
- Datatype:
Signed 32 bit integer
- Amount in NQT divided by One Signa in NQT (100,000,000).
- Datatype:
- TODO: Remove the conditional if https://github.com/signum-network/signum-node/pull/596 is merged
-
Referenced Transaction Full Hash
- This field depends on the height of the block for both datatype and value.
- Block height >= Constants.NQT_BLOCK (
0
for signum)- Datatype:
32 raw bytes
- The full hash bytes of the referenced transaction, or 32 empty bytes if no transaction is referenced.
- Datatype:
- Block height < Constants.NQT_BLOCK
- Datatype:
Signed 64 bit integer
- The referenced transaction ID or
0
if there is no referenced transaction.
- Datatype:
- TODO: Remove the conditional if https://github.com/signum-network/signum-node/pull/596 is merged
-
Transaction Signature
- Datatype:
64 raw bytes
- The signature for this transaction.
- Datatype:
-
Transaction Flags
- Optional: Include only if transaction version is greater than zero.
- Datatype:
Signed 32 bit integer
- A set of bit flags encoded into a single integer via a bitwise OR:
00000001
=message
flag00000010
=encryptedMessage
flag00000100
=publicKeyAnnouncement
flag00001000
=encryptToSelfMessage
flag
-
Transaction ec Block Height
- Optional: Include only if transaction version is greater than zero.
- Datatype:
Signed 32 bit integer
- TODO: Figure out what
ecBlockHeight
is
-
Transaction ec Block ID
- Optional: Include only if transaction version is greater than zero.
- Datatype:
Signed 64 bit integer
- TODO: Figure out what
ecBlockId
is
-
Appendages
- Datatype:
Raw bytes
- ???
- Datatype:
Database Fields in BRS
Transaction Types and Subtypes
- Payment
- Value:
0
- Subtypes:
- Ordinary Payment
- Value:
0
- Value:
- Ordinary Payment Multi-out
- Value:
1
- Value:
- Ordinary Payment Same-out
- Value:
2
- Value:
- Ordinary Payment
- Value:
- Messaging
- Value:
1
- Subtypes:
- Arbitray Message
- Value:
0
- Value:
- Alias Assignment
- Value:
1
- Value:
- Account Info
- Value:
5
- Value:
- Alias Sell
- Value:
6
- Value:
- Alias Buy
- Value:
7
- Value:
- Arbitray Message
- Value:
- Colored Coins
- Value:
2
- Subtypes:
- Asset Issuance
- Value:
0
- Value:
- Asset Transfer
- Value:
1
- Value:
- Ask Order Placement
- Value:
2
- Value:
- Bid Order Placement
- Value:
3
- Value:
- Ask Order Cancellation
- Value:
4
- Value:
- Bid Order Cancellation
- Value:
5
- Value:
- Asset Mint
- Value:
6
- Value:
- Add Treasury Account
- Value:
7
- Value:
- Distribute to Holders
- Value:
8
- Value:
- Asset Issuance
- Value:
- Digital Goods
- Value:
3
- Subtypes:
- Listing
- Value:
0
- Value:
- Delisting
- Value:
1
- Value:
- Price Change
- Value:
2
- Value:
- Quantity Change
- Value:
3
- Value:
- Purchase
- Value:
4
- Value:
- Delivery
- Value:
5
- Value:
- Feedback
- Value:
6
- Value:
- Refund
- Value:
7
- Value:
- Listing
- Value:
- Account Control
- Value:
4
- Subtypes:
- Effective Balance Leasing
- Value:
0
- Value:
- Effective Balance Leasing
- Value:
- Mining
- Value:
20
- Subtypes:
- Reward Recipient Assignment
- Value:
0
- Value:
- Commitment Add
- Value:
1
- Value:
- Commitment Remove
- Value:
2
- Value:
- Reward Recipient Assignment
- Value:
- Advanced Payment
- Value:
21
- Subtypes:
- Escrow Creation
- Value:
0
- Value:
- Escrow Sign
- Value:
1
- Value:
- Escrow Result
- Value:
2
- Value:
- Subscription Subscribe
- Value:
3
- Value:
- Subscription Cancel
- Value:
4
- Value:
- Subscription Payment
- Value:
5
- Value:
- Escrow Creation
- Value:
- Automated Transaction
- Value:
22
- Subtypes:
- Creation
- Value:
0
- Value:
- NXT Payment
- Value:
1
- Value:
- Creation
- Value: