2

I have seen all kinds of explanations of ABI. But I am still wondering who would use it. As per my current understanding it should be wallet apps using it. Or is it the node app? Can someone please confirm?

1

An ABI is the interface to a contract on the blockchain. Any meaningful interaction with a contract uses the ABI.

When you write a contract, you want to tell others what functions you provide and how they can interact with your contract: you do this by providing an ABI.

It's quite similar when you have any code that you want others to use, and you publish an API.

A wallet or any frontend UI can use the ABI to interact with the contract. Server backend code, such as nodejs can also use the ABI. It depends what code wants to read or write data to the contract.

  • Hi. Thanks. But who would typically call the ABI endpoints? The wallet app? – Ashish Sinha Jan 17 '17 at 7:08
  • "Typically" it would be UIs like wallets. But you can also have a server that periodically reads or writes to a contract, and it would need the ABI too. Hope that explains? – eth Jan 17 '17 at 7:14
  • So when a transaction with the contract is floated over the network, all the nodes start processing the transaction and the contract and hence they need to execute the contract (through the ABI). So does that mean the nodes should contain logic/program to call/execute ABIs (contracts in turn)? – Ashish Sinha Jan 17 '17 at 7:34
  • Nodes contain the Ethereum Virtual Machine. Transactions can have data input, and these are passed as is to the EVM. The EVM processes the input according to the contract code only. However, the code is generated by a compiler conforming to an ABI, so that UIs using the same ABI will be able to interact with the contract correctly. The example here might help: ethereum.stackexchange.com/questions/7973/… – eth Jan 17 '17 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.