SendTransaction
Requesting the content of a wallet should not be considered a transaction. This distinction is based on the fact that such a request is handled by a single node and does not impact the global state of the network. In contrast, transactions are actions that do influence the overall network state. When we refer to "affecting the global state of the network," we mean that the requested action results in a change of state and requires the execution of an operation by all nodes in the network or a specific subset of nodes.
Transactions are typically used for various purposes, including altering the contents of a wallet, executing a smart contract, or creating/modifying/destroying assets on the blockchains. Transactions serve as the primary mechanism for performing these diverse operations and involve several parameters to achieve the desired outcomes. To submit a new transaction, we use the SendTransaction method structured as follows:
ID:
Represents the hash of the transaction. Typically, it is calculated as:
Where From, To, and Payload are in hexadecimal representation without the "0x" identifier. The ID will contain the "0x" hexadecimal identifier.
From
This field represents the wallet address of the entity submitting the transaction, excluding the "0x" hexadecimal identifier. It's important to note that the wallet address must be previously registered on the selected blockchain. Additionally, the wallet is required to maintain a sufficient balance of CIRX coins to cover the transaction fees associated with the specific transaction in question. These transaction fees ensure the smooth processing and execution of the requested transaction.
To:
This field represents the wallet address of the entity receiving the transaction, excluding the "0x" hexadecimal identifier. If the specific transaction does not require a recipient address, then this field can be equal to the submitting address.
Timestamp:
Transaction timestamp in the format YYYY:MM:DD-hh:mm:ss in UDT timezone.
Payload:
A string in hexadecimal format without the "0x" hexadecimal identifier (base64 is also accepted).
Nonce:
Nonce value for the current transaction. Before submitting a new transaction, it is important to retrieve the current Nonce value from the submitting wallet and use it in the transaction. Please refer to the Get Wallet Nonce section.
Signature:
Signature of the transaction ID in hexadecimal format, without the "0x" identifier. The signature is obtained using the Elliptic curve algorithm Secp256k1 (more cryptos will be available soon).
PublicKey:
The public key of the "From" Wallet is included in the transaction to expedite the initial transaction pre-validation process. This inclusion eliminates the necessity to access wallet files to retrieve the public key during this phase, streamlining the transaction's efficiency.
Blockchain:
Blockchain address where the transaction is sent, without the hexadecimal identifier.
Type:
Types of transactions:
C_TYPE_COIN: Transaction in native coins (CIRX) without the use of Hyper Code (Smart Contract).
C_TYPE_TOKEN: Transaction in specified tokens without the use of Hyper Code.
C_TYPE_ASSET: Transaction involving a generic digital asset that is not represented by a token.
C_TYPE_CERTIFICATE: Transaction where the payload doesn't require any processing and is just a generic string.
C_TYPE_REGISTERWALLET: Transaction used to register a new wallet on a specified blockchain.
C_TYPE_HC_DEPLOYMENT: Transaction to deploy a new Hyper Code Program.
C_TYPE_HC_REQUEST: Transaction to call a specified endpoint of a Hyper Program.
C_TYPE_USERDEF: Unspecified type, defined by the user (not available yet).
If the request is successfully executed, it will return "true"; otherwise, it will return "false."
Last updated