Internal Messages & Logs
Definition
Internal messages are messages that are sent between accounts or contracts on a blockchain network. These messages are encoded and stored on the blockchain, making them tamper-proof and transparent.
When a transaction is submitted to a blockchain network, it can contain both a payload of data and a message that is sent to another contract or account on the same network. This message is included in the transaction and is executed by the network's consensus algorithm.
Internal messages can be used to trigger certain actions, exchange information, or execute other contracts. They are particularly useful for implementing more complex business logic, such as multi-step transactions or conditional payments.
Logs are simply records of events that occur on a blockchain network. They are similar to internal messages, but they are designed to provide a more detailed and structured record of specific events or activities on the network. They are generated by smart contracts or other network participants, and are stored as transactions on the blockchain. They can be used to capture a wide range of events, such as the creation or destruction of assets, changes in account balances, or the execution of specific functions within a contract.
Details
Internal messages & logs are powerful features of blockchain networks, as they enable complex interactions and workflows to be automated and executed in a transparent and secure way, providing a reliable and tamper-proof record of all network activities.
In Amberdata API's, internal messages and logs can be found as part of the response received using any of the Transaction endpoints, but we also have the internal messages and log endpoints (see below), which allows you to retrieve this information for the transactions where only a specified address is either the originator or recipient.
API Endpoints
/addresses/{hash}/functions
addresses/{hash}/logs
Availability
Our Blockchain endpoints found throughout the different On-Chain namespaces are available via REST API, WebSockets or JSON RPC. The list of supported Blockchain networks can be found in the API Documentation here.
Since we maintain our own nodes, we have every event from the genesis block forward which enables us to provide complete historical datasets for most chains we support.
Frequently Asked Questions
Can you give me an example of what might be included in an Internal Message?
- Consider a decentralized exchange (DEX) on a blockchain network. A user who wants to trade one cryptocurrency for another can submit a transaction to the DEX's smart contract. This transaction can include a message that specifies the amount and type of cryptocurrency they want to trade, as well as the price they are willing to pay. The smart contract will execute the trade and send a message to the user's account on the blockchain, confirming the transaction details and updating their account balance.
Why would someone want to analyze Log data?
- One common use case for logs is to provide audit trails for financial or business transactions. By storing a detailed record of every step in a transaction or workflow on the blockchain, logs enable participants to trace the entire history of a transaction, from its initiation to its completion.
Updated almost 2 years ago