Skip to main content

Transaction

Each data record written to the blockchain (whether it is an asset creation, one of the spark operations, supply creation and update or any other transaction type) is a blockchain transaction. Writing data to the blockchain requires a valid signature to call functions of a smart contract. The data is entered into the blockchain in intervals known as blocks. Each block is time stamped and its order and transactions are verified.

It takes 5 steps to process each transaction in the TEOS Platform.

Optional calls and actions which can be omitted are marked with * sign

1) Transaction creation​

The transaction is created for every action which requires data writing to the blockchain. Mind the difference: for example, retrieving the asset and its details involves only reading data from the blockchain, but creating a new asset requires writing to the blockchain. So, the transaction will be created only in the second case. Transaction creation is triggered when TEOS Platform receives the corresponding request from frontend or mobile apps (WLA, WLM, WLP, NOTRZR APP/WEB), third-party APIs (NOTRZR API) or via directly TEOS API call. Either way, the transaction parameters are passed to the TEOS Platform. The parameters must include the signer address (public address of the wallet that is going to sign the transaction).

2) Transaction preparation for writing to the blockchain by the TEOS Platform​

When TEOS API receives the request, it processes the request data and prepares the blockchain transaction which is ready for signing.

Parameters of the transaction including the TEOS Platform transaction id, which must be signed, are returned as the response of the corresponding TEOS API call.

Transaction parameters ready for signing can be retrieved later from the TEOS API or third party backend integrated with TEOS Platform (for example, Notardec API) using corresponding function by providing transaction id.

Or in case of direct integration with TxServer (TEOS Platform technical component responsible for the transactions processing) all transactions ready for singing can be retrieved from TxServer by authorized devices for signer address.

3) Transaction signing​

A device that holds the private key for the provided signer address receives the prepared transaction (by any mean described in the previous step). There can be many devices holding the same private key. The signature must be prepared using the private key.

Signing transaction is a process of creating signature using transaction data and private keys of the signing address. Signature can be prepared by any TEOS platform component with UI which has wallet and transaction management functionality (WLA, TX.Mobile), a tool for signing transactions automatically, a third party tool which has signing functionality (NOTRZR) and any TEOS API consumer which will introduce corresponding functionality. There are libraries and utilities which are available for widely used code languages, you can check the code of Autosigner, auto signing utility in C# provided by CoreLedger, as an example (ask your CoreLedger manager for the access if you don't have one).

Depending on the use case and the signing software, various security checks may be applied before signing in order to determine the authenticity of the transaction and device owner.

4) Transaction submission to the TEOS Platform​

Transaction must be signed and submitted to the TEOS platform for further confirmation or rejecting. Transaction can be submitted to the TEOS API using corresponding endpoint, via third party API or directly to the TxServer in case of direct integration with the technical component responsible for the transactions processing.

5) Transaction writing to the blockchain​

The signed transaction is validated and sent to the blockchain by TEOS Platform technical component responsible for transaction processing.

The status of the transaction can be retrieved from TEOS Platform using corresponding functions of the TEOS API or third-party API and will change according to the status model described in Transaction States.

info

It is not necessary that the device which creates a transaction (1) and the device that signs a transaction (3) are one and the same device. They can be different devices authorized to use the specific wallet's private keys. Monitoring the transaction status after the submission (5) can be done by any TEOS Platform consumer authorized to retrieve tenant data.

tip

Check the detailed flow of creating and submitting transactions with TEOS API in Transaction creation and submission

Transaction types available in TEOS platform​

TypeIdTransaction type
1Activate asset
2Create sparks
3Destroy sparks
4Transfer sparks
5Create supply
6Delete supply
7Restock supply
8Change exchange rate of a supply
9Extend a supply
10Run trade
11Activate amendments
12Create Controller
13Add White list Address Controller
14Remove Whitelist Address Controller
15Change Asset Controller
16Edit Controller
17Delete Controller
21Transfer Ethers
22Withdraw Ether
23Convert Ether
35 Add blacklist Address Controller
39Delete asset link
43Add asset links
44Delete assets link
45Set Whitelist Addresses
46Remove Whitelist Addresses
47Set Blacklist Addresses
48Remove Blacklist Addresses

Transaction states​

StateDescription
ReceivedTransaction is created with the state Received, at this moment it is not written to blockchain yet, it has only TxId provided by the TEOS Platform (by the technical component responsible for the transaction processing)
SubmittedTransaction is Submitted when it was signed with the private key and submitted to the TEOS Platform via TEOS API or directly to the TxServer (the technical component responsible for the transaction processing)
Revoked by userTransaction can be rejected by its initiator instead of signing then transaction gets state Revoked by user
Revoked by TxServerTransaction can be rejected by the technical component responsible for the transaction processing when submitting or committing due to some reasons. For example, if some business checks failed (signing address doesn't have enough sparks to transfer) or signing address doesn't have enough ETH necessary for writing transaction to blockchain
CommittedTransaction is Committed when it passed all checks performed by the technical component responsible for the transaction processing and was successfully written to blockchain according to the blockchain api response
Revoked by BlockchainTransaction can be rejected by blockchain when the technical component responsible for the transaction processing is trying to make a record in the blockchain
ConfirmedTransaction is Confirmed when the technical component responsible for the transaction processing has successfully read the transaction from blockchain after some blocks have passed to make sure it was written