ethereum/go-ethereum · error · Error

invalid address

Error message

invalid address

What it means

Error "invalid address" thrown in ethereum/go-ethereum.

Source

Thrown at internal/jsre/deps/web3.js:3943

        post.topics = [];
    }
    post.topics = post.topics.map(function(topic){
        return utils.toAscii(topic);
    });

    return post;
};

var inputAddressFormatter = function (address) {
    var iban = new Iban(address);
    if (iban.isValid() && iban.isDirect()) {
        return '0x' + iban.address();
    } else if (utils.isStrictAddress(address)) {
        return address;
    } else if (utils.isAddress(address)) {
        return '0x' + address;
    }
    throw new Error('invalid address');
};


var outputSyncingFormatter = function(result) {
    if (!result) {
        return result;
    }

    result.startingBlock = utils.toDecimal(result.startingBlock);
    result.currentBlock = utils.toDecimal(result.currentBlock);
    result.highestBlock = utils.toDecimal(result.highestBlock);
    result.syncedAccounts = utils.toDecimal(result.syncedAccounts);
    result.syncedAccountBytes = utils.toDecimal(result.syncedAccountBytes);
    result.syncedBytecodes = utils.toDecimal(result.syncedBytecodes);
    result.syncedBytecodeBytes = utils.toDecimal(result.syncedBytecodeBytes);
    result.syncedStorage = utils.toDecimal(result.syncedStorage);
    result.syncedStorageBytes = utils.toDecimal(result.syncedStorageBytes);
    result.healedTrienodes = utils.toDecimal(result.healedTrienodes);

View on GitHub (pinned to 6bb0588ad8)

Solutions

  1. Validate the address before sending: it must be a 20-byte hex string, optionally 0x-prefixed, or a valid direct IBAN.
  2. Use web3.isAddress(address) (or utils.isAddress) to check the value before calling inputAddressFormatter, and reject or normalize user input early.
  3. Ensure checksum-cased addresses are correct; a mixed-case address with a bad EIP-55 checksum is rejected.

Example fix

if (!web3.isAddress(to)) { throw new Error('bad recipient address'); }
web3.eth.sendTransaction({from: from, to: to, value: amount});

When it happens

Trigger: Calling web3.eth.sendTransaction, contract methods, or any formatter path that passes an address through inputAddressFormatter with a malformed, non-checksummed, or non-hex address string.

Common situations: DApp front ends passing user-typed addresses directly into transactions without validation or normalization.


AI-assisted analysis of ethereum/go-ethereum@6bb0588ad8 (2026-08-15). Data as JSON: /api/errors/8af4ab417ff22c16. Report an issue: GitHub.