Search code examples
ethereum

How do I create an ethereum burn address?


I would like to create an Ethereum address 0x..... without a private key. Obviously one way to do it is to generate one from a paper wallet and throw away the key.

But is there another way to create one without a key? (I am not certain if the Ethereum blockchain checks an address for validity outside of the 0x prefix)


Solution

  • A valid Ethereum address is a checksum hex representation of a 20byte number starting with a 0x.

    So anything between 0x0000000000000000000000000000000000000000 and 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF is a valid Ethereum address.


    You can generate a random 20byte number with openssl or a similar tool:

    openssl rand -hex 20
    

    Example output: b69c34f580d74396daeb327d35b4fb4677353fa9

    And then checksum it:

    This case-sensivity is used for checksum validation. The address is compared against the raw binary keccak-256 hash of the address bytes, and where there are letters in the same corresponding place as a “1” bit, the letter is capitalized.

    Source: https://coincodex.com/article/2078/ethereum-address-checksum-explained/

    Easier than calculating the hash and adjusting the letter capitalization based on that hash, is using a library that generates the checksum address (from a non-checkum address) for you - for example web3.js

    Example output: 0xB69c34f580d74396Daeb327D35B4fb4677353Fa9

    And you have a valid address without ever knowing the private key.