What are contract addresses?
You may have noticed your Ethereum is sometimes sent to a ‘contract address’ or ‘contract’ before being sent to the receiving wallet and showing up as your balance. What are these contract addresses and why are they used?
On the Ethereum network there two entities that can receive tokens, wallets and contracts. Wallets are controlled by people like you and me, sending funds to one another, and computer programs control contracts. These computer programs called ‘contracts’ are a set of rules for exchanging funds on the blockchain, similar to the way physical contracts dictate a set of rules for exchanging money in the physical world.
A contract also has a receiving address and can send and receive coins, similar to a wallet. However, a contract is controlled entirely by a computer program behind the contract, no humans are required.
Another critical difference between contracts and human-owned wallets is contracts have the ability to receive data. Sent data becomes an input to the computer programme dedicated to that address. For example, the data could be an identifier for a flight you want to book. The computer program will verify the funds have been received and that there is enough to purchase the flight, buy it and send you the details. Moreover, a contract could be set up to send funds back to your wallet if the flight is cancelled. The possibilities are endless. Lots and lots of these contracts are essentially what makes a decentralised application (dApp).
So why is my Ether sent to a contract address when I make a transaction to another wallet?
If a multiple signature (multi-sig) wallet sends Ethereum, it is first sent to a contract address. Transactions sent from multi-sig wallets require two or more signatures (approvals) before the funds are transferred, rather than the more traditional wallets that require just one signature. For this reason, multi-sig wallets are considered more secure.
The receiving contract address verifies and signs the transaction before the coin is sent to the desired wallet. It is for this reason that sending Ether from a multi-sig wallet requires more GAS comparative to sending Ether from a wallet that requires one signature.
So next time your Ether transaction fails due to ‘insufficient GAS,’ or you see your Ether go to a contract address you’ll know it’s because you are using a multi-sig wallet!