Over the years I've seen requests for P2SH multisignature vanity addresses.
The basic support of Vanitygen was a 1 signature out of 1 key P2SH address.
I thought it was time to add more multisignature support :-)
The code for the following proof can be found in my
https://github.com/kangaderoo/vanitygen repository.
Generating two public keys for a 2 signature out of 3 keys P2SH redeem script:
Pubkey Compressed (hex):
02a3fdb80c5da1ceb4da75e56c900da9baf2dfde0a2d2efbf81387e5ab2e91e985
Address Compressed (P2PKH):
1Q9U3bchykTsm5Ri4ZgJsgcYiBWPUSM3zE
Pubkey Compressed (hex):
03d2c632fa06281b97eba0475de8e6e4597bc19b1ce0edfb36ad889141137f7dc3
Address Compressed (P2PKH):
1BU2z1UTxmtVTrCsRWTnKuXpWXtvh9gDH3
Searching for the 2/3 P2SH address starting with 3P14159 (or
ℼ):
./vanitygen.exe -M 2 -X 5 -j [\"02a3fdb80c5da1ceb4da75e56c900da9baf2dfde0a2d2efbf81387e5ab2e91e985\",\"03d2c632fa06281b97eba0475de8e6e4597bc19b1ce0edfb36ad889141137f7dc3\"] -v -i -F compressed 3P14159
-M <M> --> script address needing M signatures
-X <scriptaddresstype> --> 5 is for bitcoin adresses starting with 3, other values could be used for alt-coins
-j [\"pubkey1\",\"pubkey2\",....,\"pubkey(N-1)\"]
--> list of keys, one key will be added by the vanitygen search to complete N keys
-v --> verbose
-i --> ignore case
-F --> public key type
Response:
Pattern: 3P14159
Pubkey Compressed (hex):
0279600e5939f4f7baace27acefcc6191f260d23d30da8c779bc557c50eaf01751
Address Compressed (P2PKH):
1BU2z1UTxmtVTrCsRWTnKuXpWXtvh9gDH3
Address (P2SH):
3P14159mYzQdm5eozWLMBkaMJMxzQKu7am
Verify the generated Private Key using the keyconv utility:
./keyconv -M 2 -X 5 -C -j [\"02a3fdb80c5da1ceb4da75e56c900da9baf2dfde0a2d2efbf81387e5ab2e91e985\",\"03d2c632fa06281b97eba0475de8e6e4597bc19b1ce0edfb36ad889141137f7dc3\",\"0279600e5939f4f7baace27acefcc6191f260d23d30da8c779bc557c50eaf01751\"]
or:
./keyconv -M 2 -X 5 -C -j [\"02a3fdb80c5da1ceb4da75e56c900da9baf2dfde0a2d2efbf81387e5ab2e91e985\",\"03d2c632fa06281b97eba0475de8e6e4597bc19b1ce0edfb36ad889141137f7dc3\"] <PrivKey>
Response:
P2SH (hex):
522102a3fdb80c5da1ceb4da75e56c900da9baf2dfde0a2d2efbf81387e5ab2e91e9852103d2c632fa06281b97eba0475de8e6e4597bc19b1ce0edfb36ad889141137f7dc3210279600e5939f4f7baace27acefcc6191f260d23d30da8c779bc557c50eaf0175153ae
P2SH address:
3P14159mYzQdm5eozWLMBkaMJMxzQKu7am
Verification in Bitcoin-qt:
createmultisig 2 "[\"02a3fdb80c5da1ceb4da75e56c900da9baf2dfde0a2d2efbf81387e5ab2e91e985\",\"03d2c632fa06281b97eba0475de8e6e4597bc19b1ce0edfb36ad889141137f7dc3\",\"0279600e5939f4f7baace27acefcc6191f260d23d30da8c779bc557c50eaf01751\"]"
Response:
"address": "3P14159mYzQdm5eozWLMBkaMJMxzQKu7am",
"redeemScript": "522102a3fdb80c5da1ceb4da75e56c900da9baf2dfde0a2d2efbf81387e5ab2e91e9852103d2c632fa06281b97eba0475de8e6e4597bc19b1ce0edfb36ad889141137f7dc3210279600e5939f4f7baace27acefcc6191f260d23d30da8c779bc557c50eaf0175153ae"
As I'm a puzzle solver, not a software professional, my github repository has a fixed setup to my personal environment and does
not automatically configure to other development environments. My personal environment also does not support OpenCL, so this
part of the code is not updated.