Both the source and destination addresses are important in a message for various reasons:
Traceability and Accountability
: The source address indicates the origin of the message, i.e., the account (smart contract) that created the message while processing a transaction. Having a fixed, unchangeable source address ensures that the origin of the message is known and cannot be tampered with. This helps establish a clear chain of actions within the network, making it possible to trace and audit transactions.
Security
: The fact that the source address cannot be arbitrarily changed or set adds a layer of security to the TON blockchain. Smart contracts rely on the immutability of the source address to prevent malicious actors from forging or manipulating messages. This helps maintain the integrity of the transactions and overall security of the network.
Interaction between Smart Contracts
: In a multi-chain architecture like TON, different smart contracts on different workchains may need to communicate and interact with each other. The source and destination addresses in a message allow for proper routing and execution of cross-contract interactions. By ensuring that the source address is fixed and unchangeable, the receiving contract can trust the origin of the message, and the correct execution of the intended actions can be ensured.
Message Routing
: As mentioned in the passage, when a message is created, any well-formed destination address can be chosen. Once set, the destination address cannot be changed. This design choice, along with the fixed source address, ensures that the routing of messages between accounts and smart contracts is efficient and secure.
In summary, having a fixed and unchangeable source address in a message is essential for maintaining traceability, security, and proper execution of transactions and interactions between smart contracts in the TON blockchain. The combination of fixed source and destination addresses enables efficient and secure message routing within the network.