-2

What are the possible lengths for addresses and seeds?

As this is important for designing a database to store these values.

1
  • ops, is this kind of question not suitable here? I thought it is good for quick lookup?
    – lulalala
    Jan 14, 2018 at 14:32

1 Answer 1

2

The address are usually 90 characters long, which includes 9 characters of checksum. (meaning char(90) column is a good fit)

(but api does accept 81 character address which are without checksum in various functions)

The seed is 81 characters long, but sometimes it can be less. However for addresses less than 81 characters long, it will need to be padded with '9'. So we should still use char(81).

5
  • 1
    As the lengths are constant, I'd use char(90) or char(81) instead.
    – mihi
    Jan 13, 2018 at 16:01
  • for postgres, there is no performance advantage to using char over varchar. postgresql.org/docs/9.0/static/datatype-character.html Jan 13, 2018 at 18:51
  • I didn't suggest it for performance advantages but because on most DBMS they are smaller (if filled completely) as there is no need to store the length (don't know about Postgres though).
    – mihi
    Jan 13, 2018 at 23:10
  • @mihi I recall that seed can be less than 81 characters, so char will not do. I guess address is always 90 characters though?
    – lulalala
    Jan 14, 2018 at 14:36
  • 2
    It is possible to enter less than 81 characters for the seed in the current reference wallet implementation (the wallet will pad the seed with 9 at the end). When using the API, the seed has to be exactly 81 characters long.
    – mihi
    Jan 14, 2018 at 17:20

Your Answer

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

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