Bitcoin Forum

Bitcoin => Electrum => Topic started by: chucrut on April 12, 2022, 03:09:19 PM



Title: HELP. I need to know if my Electrum address is correct
Post by: chucrut on April 12, 2022, 03:09:19 PM
Hello. I'm a beginner. I generated an Electrum address:
bc1qh2zlse6nm8rtqkcvxx32jxea0jc2akp4pvw93y

But I have the feeling the address is not correct.
Please, could you help me?


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: OmegaStarScream on April 12, 2022, 03:10:29 PM
What do you mean by you don't know if it's correct? if you're unsure whether this address was generated by you or not, then you could go to the Electrum's console and type the following:

Code:
ismine("bc1qh2zlse6nm8rtqkcvxx32jxea0jc2akp4pvw93y")

If it returns true then it belongs to you.

If you think you mistyped the address, then the above will help you as well. You can also use a block explorer:

https://www.blockchain.com/btc/address/bc1qh2zlse6nm8rtqkcvxx32jxea0jc2akp4pvw93y

You don't have to worry about this anyway since wallets and exchanges verify the address format as well so if you give it to someone, they'll know there's something with the address and won't be able to send the funds.


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: chucrut on April 12, 2022, 03:19:51 PM
I mean I would like to check if the number of characters is correct and the format is correct.
I tried to verify in some websites, and they tell me the address is not valid.
I would like to know what is missing in the address


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: NeuroticFish on April 12, 2022, 03:22:08 PM
But I have the feeling the address is not correct.

If that feeling is based on the fact you may only know legacy addresses ( like 17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem ), then you should know that there are more valid types of addresses.
You may want to read...
* easy version, only the address types: https://shiftcrypto.ch/blog/what-are-bitcoin-address-types/
* full version, all known prefixes (also contains private keys and so on) : https://en.bitcoin.it/wiki/List_of_address_prefixes


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: OmegaStarScream on April 12, 2022, 03:22:49 PM
I mean I would like to check if the number of characters is correct and the format is correct.
I tried to verify in some websites, and they tell me the address is not valid.
I would like to know what is missing in the address

As I explained above, your address is valid. Which website did you use? You must've used a service that doesn't support bech32 addresses (addresses that start with bc1).

In addition to block explorers, another way to verify the validity of an address is by trying to send funds to it. As an example, I took your address and added an f to it:

https://i.imgur.com/f4dRhqP.png


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: chucrut on April 12, 2022, 03:52:10 PM
What do you mean by you don't know if it's correct? if you're unsure whether this address was generated by you or not, then you could go to the Electrum's console and type the following:

Code:
ismine("bc1qh2zlse6nm8rtqkcvxx32jxea0jc2akp4pvw93y")

If it returns true then it belongs to you.

If you think you mistyped the address, then the above will help you as well. You can also use a block explorer:

https://www.blockchain.com/btc/address/bc1qh2zlse6nm8rtqkcvxx32jxea0jc2akp4pvw93y

You don't have to worry about this anyway since wallets and exchanges verify the address format as well so if you give it to someone, they'll know there's something with the address and won't be able to send the funds.

Many thanks!!. I think that is a good way to verify the address.
I really appreciate your help!


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: Findingnemo on April 12, 2022, 05:11:01 PM
You can also use the addresses tab to find whether the address you copied is there or not, if your device is infected with clipboard malware then the hacker can able to replace the copied address to his desired one so its always good to check twice or more times the characters are matching with the address you're copied from.


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: BitMaxz on April 12, 2022, 11:04:54 PM
~snip~

Just adding this if it's the format and number of characters is your problem I would like you to read this wiki page below and segwit address has 42 characters and 62 characters in a Taproot address.

- https://en.bitcoin.it/wiki/List_of_address_prefixes

And about some website that tells you that your address is not valid, there are some of them that are not accepting bech32(Segwit) address compared to using Legacy addresses that start with "1".

And I think most of the websites right now should support segwit addresses if you found a website do not support Segwit they have outdated service and I suggest you post the website here to verify if the website you are dealing with is legit or a scam.


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: Pmalek on April 15, 2022, 08:17:04 AM
Just adding this if it's the format and number of characters is your problem I would like you to read this wiki page below and segwit address has 42 characters and 62 characters in a Taproot address.
Native Segwit addresses can actually contain up to 90 characters, but I don't think I have ever seen such an address in the wild. Those long ones probably use more complex scripts, which affects the addresses' length. 


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: khaled0111 on April 15, 2022, 11:13:29 AM
I mean I would like to check if the number of characters is correct and the format is correct.
I tried to verify in some websites, and they tell me the address is not valid.
I would like to know what is missing in the address
Each bitcoin address has a checksum which you can verify to check the validity of the address. The number of characters is irrelevant and isn't a reliable way to determine the validity of an ddresse since bitcoin addresses don't have a fixed length.

If you usually copy-paste addresses, then what you really need to check is that the pasted address is the same as the one you copied (original) rather than caring about its validity (most wallet apps will warn you when you provide an invalid address).


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: BitMaxz on April 15, 2022, 11:51:41 PM
Native Segwit addresses can actually contain up to 90 characters, but I don't think I have ever seen such an address in the wild. Those long ones probably use more complex scripts, which affects the addresses' length. 

Well never seen any addresses yet more than 62 characters I mostly use segwit addresses with 42 characters and sometimes taproot addresses with 62 characters sample this address(bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97) with a large number of funds.

No one yet seems planning to use a 90 characters address?


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: Pmalek on April 16, 2022, 06:50:10 AM
No one yet seems planning to use a 90 characters address?
I don't think it's something you can decide to generate just for the purpose of having such a long address and for fun. If you have a standard wallet that generates 42-character addresses, it won't all of a sudden generate a 90-character one. Someone with more technical knowledge will probably chip in and describe what it takes to do that. In my limited understanding, it requires a much more complex script.   


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: NeuroticFish on April 16, 2022, 11:41:12 AM
Well never seen any addresses yet more than 62 characters

Well, according to this bech32 playground page (https://slowli.github.io/bech32-buffer/) the initial data cannot be too long:

Note that version 0 scripts should have length 20 or 32 bytes.

Hence on version 0 I couldn't make longer "addresses". than 62 chars.
But on other versions I've got (from random data I don't understand) rather easily1 73 chars long address2. It has the source available though in case it helps anybody...


1 From less than 20 attempts.
2 bc1s3ztqrmj5aff3xws88atj8getytd03nf4g90g3vllwv3qjlwhxer9dzmzp4lmdvg2vypk8


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: o_e_l_e_o on April 16, 2022, 01:40:33 PM
The permissible lengths of bech32 addresses is currently laid out in BIP173 (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#segwit-address-format), BIP141 (https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program), and BIP341 (https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#script-validation-rules) (links lead to relevant sections).

BIP173 states that the data being encoded must be between 2 and 40 bytes long, which once encoded along with the human readable part, separator, and witness version, gives a length of between 14 and 74 characters.
BIP141 states that for witness version 0 (native segwit), the data must be either 20 or 32 bytes long, giving addresses which are either 42 (P2WPKH) or 62 (P2WSH) characters.
BIP341 states that for witness version 1 (taproot), the data must be 32 bytes long, giving addresses of 62 characters.

So the longest bech32 address at present is 62 characters, but we currently have the option of going up to 74 characters in future versions if needed.


Title: Re: HELP. I need to know if my Electrum address is correct
Post by: pooya87 on April 17, 2022, 03:04:02 AM
Native Segwit addresses can actually contain up to 90 characters, but I don't think I have ever seen such an address in the wild. Those long ones probably use more complex scripts, which affects the addresses' length. 
Keep in mind that the address is encoding the witness program not necessarily the script. So far the program has been the HASH160 of public key or the SHA256 of the redeem script for version 0 or the 32 byte tweaked pubkey. So their sizes are fixed and small.