How do I distinguish between a contract address and a wallet address?

Confusions often arise as to the difference between a wallet address and a contract address mostly because they look similar. However, before we explain how you can differentiate between both addresses, let's take a look at what they mean below.

What is a contract address?

A contract address is a unique identifier for a smart contract deployed on a blockchain. Smart contracts are self-executing agreements that follow predefined rules and automatically enforce actions when specific conditions are met.

What is a wallet address?

A wallet address is a string of letters and numbers from which cryptocurrencies or NFTs can be sent to and from.

How then can I differentiate between the two addresses

A super easy way to distinguish between a contract address and a wallet address is by calling the [eth_getCode]( method, which will return a contract code if it's a contract and nothing if it's a wallet. Here's an example of both using our composer tool: