7

Question:

How many (or up to how many) characters does a Ethereum address have?

Elaborating:

I have been looking online for an answer but it seemed harder to find than I expected.

I am working on storing a list of Ethereum addresses with web3.js in a MySQL database, and need to know the limit of characters I should put for the VARCHAR. I could ofcourse put a very high value like 100 and be safe from not having enough space, however that would cost some speed.

1
  • If you just need to store the raw address, @jeff's answer below is correct. If you're looking to store ways of referring to Ethereum accounts, you may want to ensure that your table supports things like the Ethereum name service (ENS). While ENS does map things to addresses that can be expressed using 40-character hex strings by hashing them, you may want to store the pre-hashed values which can be arbitrarily long and can be unicoded. You'll still want to put a character limit on your column, but you'll want to at least set an encoding for the column to support unicode.
    – lungj
    Commented Jul 14, 2017 at 3:05

2 Answers 2

10

Ethereum addresses are often represented as 40-character hexadecimal strings. If you want to save with the hex prefix ("0x"), 42 characters should be enough.

0
1

0x0000000000000000000000000000000000000000 how to generate address keep 37 chracter constant and generate last 5 characters like this

0x0000000000000000000000000000000000000001 0x0000000000000000000000000000000000000002 0x0000000000000000000000000000000000000003 0x0000000000000000000000000000000000000005 0x0000000000000000000000000000000000000006 0x0000000000000000000000000000000000000007 0x0000000000000000000000000000000000000008 0x0000000000000000000000000000000000000009 0x0000000000000000000000000000000000000010 0x0000000000000000000000000000000000000011 0x0000000000000000000000000000000000000012 0x0000000000000000000000000000000000000013 0x0000000000000000000000000000000000000014 0x0000000000000000000000000000000000000015

i tried many scripts but it generates random not like this, i am running a script that generates more than 1million in just one minutes but not generating like this.......

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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