No, smart contracts cannot interact with the world outside of the blockchain on which they live. For example, a smart contract cannot act as a REST endpoint or data source. Smart contracts can interact with other contracts in the same environment, or with compatible external libraries. When creating an external library to interact with a Casper smart contract, consider the following:
- Wasm is expressed as
little-endianby default. Check for endianness compatibility.
wasm32-unknown-unknownis a 32-bit platform, it cannot support 64-bit external code. Your library needs to be compatible with 32-bit code.
- Consider a library that supports
- Try to avoid native operating system calls. If the library uses the filesystem, sockets, or other native OS functionality, then it may not work with a Casper smart contract.
If you have any concerns, questions, or issues, please submit a request to our support team here: