---
description: Send a new transaction on the blockchain.
---

# Submit a new Transaction

<mark style="color:green;">`POST`</mark> `Circular_AddTransaction_`

Requesting the content of a wallet should not be considered a transaction. This distinction arises because such a request is handled by a single node and does not affect the global state of the network. Transactions, in contrast, are actions that have an impact on the overall network state.

When we talk about "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.&#x20;

Transactions are typically used for various purposes, including modifying the contents of a wallet, executing smart contracts, or creating/modifying/destroying assets on the blockchains. Transactions are the primary mechanism for carrying out these diverse operations and involve several parameters to achieve the desired outcomes.

To submit a new transaction, the URL structure is as follows:

```json
URL = [NAG URL]Circular_AddTransaction_

TBody = {
          "ID" : ID,
          "From" : From,
          "To" : To,
          "Timestamp" : Timestamp,
          "Payload" : Payload,
          "Nonce" : Nonce,
          "Signature" : Signature,
          "PublicKey" : PublicKey,
          "Blockchain" : Blockchain,
          "Type" : Type 
    }
```

## **ID:**

This represents the transaction hash, which is usually calculated as:

```json
ID = "0x" + sha256( From + To + Payload + Timestamp)
```

Where "From," "To," and "Payload" are in hexadecimal representation without the "0x" identifier, while the "ID" will contain the "0x" hexadecimal identifier.

## From:

This field represents the wallet address of the entity initiating the transaction, without the "0x" hexadecimal identifier. Please note that the wallet address must be pre-registered on the chosen blockchain. \
\
Furthermore, the wallet must maintain an adequate balance of CIRX coins to cover the transaction fees associated with the particular transaction. These fees are essential for the seamless processing and execution of the requested transaction.

## To:

This field represents the wallet address of the transaction recipient, without the "0x" hexadecimal identifier. If the particular transaction doesn't necessitate a recipient address, this field can be the same as the sender's address.

## Timestamp:

Transaction timestamp in format YYYY:MM:DD-hh:mm:ss in UDT timezone.

## Payload:

String in hexadecimal format without the "0x" hexadecimal identifier (base64 is also accepted).

## Nonce:

Nonce value for the current transaction. It's crucial to obtain the current Nonce value from the sending wallet and incorporate it into the new transaction. For more information, 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 Elliptic curve algorithm Secp256k1 (more cryptos will be available soon).

```json
Signature = signMessage( ID, From_PrivateKey );
```

## Public Key:

The public key of the "From" Wallet is included in the transaction to expedite the initial transaction pre-validation process. This eliminates the need to access wallet files for public key retrieval during this phase, thus enhancing the efficiency of the transaction.

## Blockchain:

Blockchain Address where the transaction is sent, without the hexadecimal identifier.

## Type:

Types of transactions:

* **C\_TYPE\_COIN:** Transaction involving native coins (CIRX) without the use of Hyper Code (Smart Contracts).
* **C\_TYPE\_TOKEN:** Transaction involving 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 processing and is 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).

## Request

**Head**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name         | Type   | Description                                                                                     |
| ------------ | ------ | ----------------------------------------------------------------------------------------------- |
| `ID`         | string | Calculated TxID                                                                                 |
| `From`       | string | Wallet address excluding the "0x" hexadecimal identifier                                        |
| `To`         | string | Receiver's wallet address excluding the "0x" hexadecimal identifier                             |
| `Timestamp`  | string | Date string in "YYYY:MM:DD-HH:mm:ss" format                                                     |
| `Payload`    | string | String in hexadecimal format without the "0x" hexadecimal identifier (base64 is also accepted). |
| `Nonce`      | string | Nonce value for the current transaction.                                                        |
| `Signature`  | string | Signature of the transaction ID in hexadecimal format, without the "0x" identifier.             |
| `Blockchain` | string | Blockchain address excluding the "0x" hexadecimal identifier                                    |
| `Type`       | string | One of the types listed before                                                                  |

**Result**

{% tabs %}
{% tab title="200" %}
<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "Result": 200,
  "Response": {
    "TxID": "138dd7a19685c71f281d8f5b9d0de15dc7ce7e9433e1715ec6e45e0fade74c82",
    "Timestamp": "2024:09:26-21:57:12"
  },
  "Node": "8a93c6b6f8d166097ddfeb3e5e3a2998b35e0b6f0bd2e31a8a130a11b6749279"
}
</code></pre>
{% endtab %}
{% endtabs %}
