Creating a Custom Bitcoin Address

17 replies 97 views
nova_byteFull Member
Posts: 25 · Reputation: 755
#1May 14, 2020, 10:11 PM
Can I make a Bitcoin address with a specific string? I don't wanna deal with private or public keys, just something unique to put on the blockchain. Thinking of using Python 3 and maybe brute-forcing it.
5 Reply Quote Share
mr_apeNewbie
Posts: 401 · Reputation: 35
#2May 15, 2020, 03:27 AM
You don't need to brute force it. Just follow these steps: 1. Avoid invalid characters like 0OIl. 2. Keep your string short to fit the address length (160-bit hash when decoded). 3. Convert your string to bytes and pad it with zeros to make it 160 bits. 4. Use Base58check encoding on the result. It'll handle checksums and version bytes for you.
3 Reply Quote Share
nova_byteFull Member
Posts: 25 · Reputation: 755
#3May 15, 2020, 09:26 AM
I want the final address to literally have my string in it, not just the bytes before encoding.
4 Reply Quote Share
wizard_2016Full Member
Posts: 127 · Reputation: 575
#4May 15, 2020, 11:16 AM
Addresses aren't just random strings; they aren't stored directly in the blockchain. Block explorers and wallets reconstruct them from transactions. As mentioned by @pooya87, a legacy address comes from a 160-bit hash, plus a version and checksum that you can't control much.
4 Reply Quote Share
nova_byteFull Member
Posts: 25 · Reputation: 755
#5May 17, 2020, 03:07 PM
But you just gave an example of a string in a blockchain address. That's exactly what I'm after! I want my string in the address without needing keys.
0 Reply Quote Share
Posts: 23 · Reputation: 204
#6May 17, 2020, 07:31 PM
If you have "MyString" and want it on the address, you could base58decode_check("MyStringChecksum"), tweak the bytes for length and checksum, then base58encode_check those bytes to get your address. I just need to see how to code that in Python 3.
4 Reply Quote Share
nova_byteFull Member
Posts: 25 · Reputation: 755
#7May 19, 2020, 10:44 AM
Sounds like you want something specific. Here's the output: if your string is too long, you'll get multiple addresses, otherwise just one. That what you mean?
3 Reply Quote Share
nova_byteFull Member
Posts: 25 · Reputation: 755
#8May 19, 2020, 11:27 PM
Yes, is there Python code for this? I can't find anything like that in the libraries.
0 Reply Quote Share
0xGasMember
Posts: 292 · Reputation: 52
#9May 20, 2020, 05:45 AM
How's that supposed to help? You need a way to generate it.
0 Reply Quote Share
m1kes4tFull Member
Posts: 167 · Reputation: 252
#10May 20, 2020, 06:27 AM
There's no need for brute force; you're just making a burn address without a key. I once used a web tool that let you enter something like "1Whatever" and it generated an address starting with that. Searching online for creating burn addresses might be helpful.
1 Reply Quote Share
nova_byteFull Member
Posts: 25 · Reputation: 755
#11May 20, 2020, 10:19 AM
I think I shared a script before but lost the link. Just remember to stick to valid base58 characters. I did some mini brute force to get the checksum in check.
1 Reply Quote Share
Posts: 23 · Reputation: 204
#12May 20, 2020, 12:52 PM
That's exactly what I need! I'll give it a run once I verify the script. What should I use for the goal/prefix variables?
4 Reply Quote Share
m1kes4tFull Member
Posts: 167 · Reputation: 252
#13May 22, 2020, 01:07 AM
Why say that? The library has a wrapper ready for this. Just two lines of Python should do it.
0 Reply Quote Share
nova_byteFull Member
Posts: 25 · Reputation: 755
#14May 22, 2020, 05:57 PM
goal = "1bitcointaLkforumburnLegacyaddress" prefix = "1BitcoinTALKforumBurnLegacyaddr" The prefix shows how many characters you want to match. If it's taking too long, you might be using too much space for the checksum.
4 Reply Quote Share
Posts: 23 · Reputation: 204
#15May 22, 2020, 08:36 PM
Trying what you posted and getting results.
0 Reply Quote Share
nova_byteFull Member
Posts: 25 · Reputation: 755
#16May 22, 2020, 09:13 PM
Steps: 1. Clone or download the repo to your PC. 2. deal with to that folder and run your Python scripts. That's it.
3 Reply Quote Share
Posts: 3523 · Reputation: 35
#17May 23, 2020, 01:40 AM
Maybe your secp256k1 library is clashing with another one from a different source.
6 Reply Quote Share
Posts: 3523 · Reputation: 35
#18May 23, 2020, 04:36 AM
It worked! Thanks a ton!
1 Reply Quote Share

Related topics