Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Kostelooscoin on October 20, 2019, 01:16:28 PM



Title: Generate bitcoin address other base58
Post by: Kostelooscoin on October 20, 2019, 01:16:28 PM
Hello to generate a bitcoin address we use base58 and I would like to know if it was possible to generate a bitcoin address with 1 character less in the base58 example generate an address with base58?

Thank you for your help


Title: Re: Generate bitcoin address other base58
Post by: jackg on October 20, 2019, 01:22:03 PM
If you're trying to save on a character just take the separator off the start (I. E the starting 1, 3 or bc1) and then add it when you need it. Or just use a higher base... (but you'll have to convert it before putting it into wallet software for sending).

But your op is ambiguous you might have better luck posting in your native language.


Title: Re: Generate bitcoin address other base58
Post by: Kostelooscoin on October 20, 2019, 01:25:56 PM
I don't understand very well, let's say that if I take a program that uses base58 and modify it to base58 the address will be valid or not?


Title: Re: Generate bitcoin address other base58
Post by: Deathwing on October 20, 2019, 04:54:09 PM
I don't understand very well, let's say that if I take a program that uses base58 and modify it to base58 the address will be valid or not?

A program that uses base58 and modify it to use base58? The question you are asking, as jackg pointed out, is very vague.


Title: Re: Generate bitcoin address other base58
Post by: DannyHamilton on October 20, 2019, 05:45:41 PM
I don't understand very well, let's say that if I take a program that uses base58 and modify it to base58 the address will be valid or not?


Yes.

No.

Maybe.

It depends on what you are trying to do, and why.  Addresses are something the wallet software shows to us humans to make it easier for us to talk about the transfer of control over value.  In the actual tranasactions, there aren't any addresses.

So, you can create a wallet program with any "address" representation you want to invent (as long as it converts the address into the appropriate output script when it builds the transaction.


However, this has all the signs of being an XY PROBLEM (https://en.wikipedia.org/wiki/XY_problem).  You will probably get much better help if you explain what you are actually trying to do, and why.


Title: Re: Generate bitcoin address other base58
Post by: Kostelooscoin on October 20, 2019, 06:10:09 PM
Ok let's take an example from an address that is as follows: 12DeDN7BeK2zRTaXKWNUE4m5R4Y5aUuGL7

I would only like to generate other addresses of the same type by removing from the database58 the letters and numbers that are not present in the address


Title: Re: Generate bitcoin address other base58
Post by: LoyceV on October 20, 2019, 06:22:01 PM
Ok let's take an example from an address that is as follows: 12DeDN7BeK2zRTaXKWNUE4m5R4Y5aUuGL7

I would only like to generate other addresses of the same type by removing from the database58 the letters and numbers that are not present in the address
So you want more addresses with only the following characters?
Code:
B
D
E
G
K
L
N
R
T
U
W
X
Y
a
e
m
u
z
1
2
4
5
7
Sure that's possible, by using brute-force: use (or modify) vanitygen (https://bitcointalk.org/index.php?topic=25804.0), and select the addresses that match your requirement.

Do you mind sharing what you're trying to accomplish?


Title: Re: Generate bitcoin address other base58
Post by: jackg on October 20, 2019, 06:25:18 PM
Ahhh in number theory, base5i refers to a number base (more on that later) the only redundancies are a checksum and the 1, all should be kept just in case.

A base refers to the number system used:
denary which includes symbols [0-9] only
Hexadecimal is another system which includes [0-9|A-F]
Binary is [0|1]
Octinary is [0-7]


Base 58 is [0-9|A-Z|a-z] without zero, uppercase I, uppercase o and lower case l.

For further reading check here: https://en.m.wikipedia.org/wiki/Base58


Title: Re: Generate bitcoin address other base58
Post by: Kostelooscoin on October 20, 2019, 06:32:15 PM
Ok let's take an example from an address that is as follows: 12DeDN7BeK2zRTaXKWNUE4m5R4Y5aUuGL7

I would only like to generate other addresses of the same type by removing from the database58 the letters and numbers that are not present in the address
So you want more addresses with only the following characters?
Code:
B
D
E
G
K
L
N
R
T
U
W
X
Y
a
e
m
u
z
1
2
4
5
7
Sure that's possible, by using brute-force: use (or modify) vanitygen (https://bitcointalk.org/index.php?topic=25804.0), and select the addresses that match your requirement.

Do you mind sharing what you're trying to accomplish?

I tried to modify vanitygen but when I remove some characters some addresses are not valid


Title: Re: Generate bitcoin address other base58
Post by: LoyceV on October 20, 2019, 06:55:03 PM
I tried to modify vanitygen but when I remove some characters some addresses are not valid
You can create a list, then search through it. However, it's very unlikely.
From your earlier example, I created just over 100,000 addresses, and checked how many of them still qualify each time I require one extra character from your list:
Code:
Number of addresses that contain 1: 137563
Number of addresses that contain 2: 62151
Number of addresses that contain 4: 27959
Number of addresses that contain 5: 12077
Number of addresses that contain 7: 5146
Number of addresses that contain B: 2191
Number of addresses that contain D: 922
Number of addresses that contain E: 364
Number of addresses that contain G: 136
Number of addresses that contain K: 51
Number of addresses that contain L: 19
Number of addresses that contain N: 4
Number of addresses that contain R: 2
Number of addresses that contain T: 0
Number of addresses that contain U: 0
Number of addresses that contain W: 0
Number of addresses that contain X: 0
Number of addresses that contain Y: 0
Number of addresses that contain a: 0
Number of addresses that contain e: 0
Number of addresses that contain m: 0
Number of addresses that contain u: 0
Number of addresses that contain z: 0
The only 2 addresses that have all characters up to the R:
Address: 1BoG2KdqFw48V715E8Szp7pCNLDtjiS9RU
Privkey: 5JCyYxJb6e6KpHZDKVhBcYBNg8YeJSEPcbVaZjQ8W5U6qXGddu3
Address: 17uw5D4GwPNRKLNBZMNP7EHhiKphho82yk
Privkey: 5Jhxk9p4VAbqD2Jd4pukZK8ReqXwRdABRvLyMfMRUAFKBZ1CN4f

Note that I still don't eliminate the addresses with characters that aren't in your list, that would make the final list even shorter.


Title: Re: Generate bitcoin address other base58
Post by: Kostelooscoin on October 20, 2019, 07:01:23 PM
I tried to modify vanitygen but when I remove some characters some addresses are not valid
You can create a list, then search through it. However, it's very unlikely.
From your earlier example, I created just over 100,000 addresses, and checked how many of them still qualify each time I require one extra character from your list:
Code:
Number of addresses that contain 1: 137563
Number of addresses that contain 2: 62151
Number of addresses that contain 4: 27959
Number of addresses that contain 5: 12077
Number of addresses that contain 7: 5146
Number of addresses that contain B: 2191
Number of addresses that contain D: 922
Number of addresses that contain E: 364
Number of addresses that contain G: 136
Number of addresses that contain K: 51
Number of addresses that contain L: 19
Number of addresses that contain N: 4
Number of addresses that contain R: 2
Number of addresses that contain T: 0
Number of addresses that contain U: 0
Number of addresses that contain W: 0
Number of addresses that contain X: 0
Number of addresses that contain Y: 0
Number of addresses that contain a: 0
Number of addresses that contain e: 0
Number of addresses that contain m: 0
Number of addresses that contain u: 0
Number of addresses that contain z: 0
The only 2 addresses that have all characters up to the R:
Address: 1BoG2KdqFw48V715E8Szp7pCNLDtjiS9RU
Privkey: 5JCyYxJb6e6KpHZDKVhBcYBNg8YeJSEPcbVaZjQ8W5U6qXGddu3
Address: 17uw5D4GwPNRKLNBZMNP7EHhiKphho82yk
Privkey: 5Jhxk9p4VAbqD2Jd4pukZK8ReqXwRdABRvLyMfMRUAFKBZ1CN4f

Note that I still don't eliminate the addresses with characters that aren't in your list, that would make the final list even shorter.

How did you do that?


Title: Re: Generate bitcoin address other base58
Post by: LoyceV on October 20, 2019, 07:05:09 PM
How did you do that?
I used vanitygen to create a list of addresses, then searched one by one for addresses containing the required character.
But vanitygen is terribly slow to output all addresses, if you adjust the source (or even better: adjust oclvanitygen), you should be able to search 100 times my list per second (depending on hardware).


Title: Re: Generate bitcoin address other base58
Post by: Kostelooscoin on October 21, 2019, 11:30:12 AM
i modified vanitygen 'util.c' to :

Code:
const char *vg_b58_alphabet = "12457BDEGKLNRTUWXYaemuz";

const signed char vg_b58_reverse_map[256] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1,  0,  1, -1,  3,  4, -1,  6, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 10, -1, 12, 13, -1, 15, -1, -1, -1, 18, 19, -1, 21, -1,
-1, -1, 24, -1, 26, 27, -1, 29, 30, 31, -1, -1, -1, -1, -1, -1,
-1, 33, -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, 44, -1, -1,
-1, -1, -1, -1, -1, 52, -1, -1, -1, -1, 57, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};

but result :

./vanitygen 1BD
Difficulty: 1330
Pattern: 1BD                                                                   
Address: 1LRU  RBL
Privkey: 7Y1ctt znhOfrtX7 rtYgicBer o XiO


Title: Re: Generate bitcoin address other base58
Post by: jackg on October 21, 2019, 12:07:40 PM
So your address and private key are now in base 23?

Loyce meant editing it so that it doesn't return anything that aren't the characters you want. For starters as validation to see if you're on the right track, the private key should start with a 5.


Title: Re: Generate bitcoin address other base58
Post by: LoyceV on October 21, 2019, 01:29:47 PM
Loyce meant editing it so that it doesn't return anything that aren't the characters you want.
It's easier to use vanitygen with regex, as explained by KingZee (https://bitcointalk.org/index.php?topic=25804.msg47720951#msg47720951):
Code:
vanitygen -r '^1[BDEGKLNRTUWXYaemuz12457]{16}'
Using vanitygen is much slower than using oclvanitygen, and the regex slows it down even more. It's 80 times slower than my usual speed, but it works.
In the above expression, "20" means it searches for a match for the first 16 characters only. That's less than Kostelooscoin wants, but at least this gives some result without waiting forever.
To get a better match, increase that number. Or allow more different characters, that'll greatly improve speed.

Another example:
This gets you a private key without lower case characters:
Code:
vanitygen -r '^1[123456789ABCDEFGHJKLMNPQRSTUVWXYZ]{33}'

You can also add "-k" to the options, and search for a bit less characters. This way you at least get to see some progress when searching for rare outputs.