- An internal transaction can occur from smart contract logic which can get initiated by an external transaction.
- These transactions get transmitted from externally owned accounts to smart contracts.
Blockchains can enable the exchange of value in ways that were not available prior to their creation.
They do so by relying on smart contracts. However, the complexity of these contracts can make it difficult for developers to understand what is actually occurring within the transaction.
Internal Transactions, as such, are the interactions from one smart contract to another. This type of transaction has seen a lot of usage in the Ethereum ecosystem as it is one of the largest blockchain featuring smart contract support.
In normal transactions, a transfer is carried out through the usage of a smart contract, as is the case with the Ethereum blockchain. However, in internal transactions, the internal transaction is the consequence or the result of a smart contract’s logic, triggered by the external transaction.
How do Internal Transactions work?
A single transaction occurs on top of a smart contract can result in hundreds of internal transactions, all of which interact with a variety of other smart contracts or distribute value to a host of different wallets, in the use-case of an airdrop, for example.
- In normal transactions, there are cryptographic signatures, such as a transaction hash or transaction ID.
- There are no cryptographic signatures in internal transactions, such as the aforementioned hash or ID.
- Normal transactions get created when a user initiates transfers of assets from their wallet to another wallet address on the blockchain.
- Internal transactions are the consequence of the logic triggered by external transactions on smart contracts, resulting in an internal contract.
In order to view these transactions, each user will need to run the transaction and trace the calls made. This requires additional gas fees, however.
The operation of tracing transactions can take a prolonged period. This operation is CPU intensive and takes a toll on nodes. If the node is not powerful enough, it can break while in the procedure of tracing and cause issues for the rest of the data on the node.
As such, nodes need to have a specific capacity and processing power to track internal transactions. Additionally, if a user aims to retrieve any information older than 30 minutes, they would require an Archive Node, a node containing the entire blockchain’s history.
The Issue of Internal Transactions
- The key issue which has been a part of internal transactions ever since they were created is they do not feature detailed information. This results in users typically ending up without much data when it comes to their address.
- This leads to a different requirement, such as the re-execution of the transaction through the Ethereum Virtual Machine (EVM) in the case of the Ethereum blockchain, and then, they need to individually trace the calls made by the transaction.
- However, tracking the outcome of this internal transaction will typically have issues of its own, as tracing transactions can be very slow.
The trace results for the internal transaction can also be large as well as difficult for storage and retrieval at a later point in time.
There are also limitations associated with the nodes, where, if unprepared, they will typically only store data for about 30 minutes worth of blocks back. After interacting with a smart contract, the time window is important for making actions, assuming developers aim to obtain information on any probable occurring internal transactions.
How to Get Internal Transactions?
We need to see how internal transactions differ from normal ones:
- In normal transactions, all of the details are listed on them, and there is no difficulty when it comes to tracking the results because the data is easily retrievable. Additionally, these are actions initiated by externally owned accounts, such as people’s cryptocurrency wallets.
- In internal transactions, there are no details listed. The outcome features a higher level of difficulty when tracking the data, as the information later than 30 minutes needs to be in an archive node, being expensive to operate by individual developers. These are smart contract transactions as well, not externally owned.
- In terms of the storage location, normal transactions get stored on-chain and are a direct part of the blockchain, and the address balances are not affected. In the case of internal transactions, however, they are stored off-chain and are not a part of the blockchain, meaning they also affect address balances.
Based on all of the aforementioned data, it is clear each developer will need to either gain access to an archive node in order to be able to trace internal transactions or leverage a different type of solution, one giving them access to the data within a 30-minute time window.
NOWNodes is a blockchain-as-a-service provider which gives Application Programming Interfaces (APIs) for a vast number of the blockchain network, many of which can easily provide developers or any other curious users with access to the required information.
The result of this is neither developers nor enthusiasts have to go through the vigorous process of setting up tracers or wait for results that might not eventually even come up.
NOWNodes is a service providing users with access to almost 60 available nodes, and all of them feature an API with an uptime of 99.95%.
NOWNodes also supports internal transactions, and any developer can leverage this data to build their solutions even further.GET ACCESS TO FULL NODEs