Closed eulerbeat5 closed 1 year ago
@k06a please, what is seed public key? does the user have to provide seed public key?
@eulerbeat provide public key from any private key you own, you will need to add "profanity2" private key to the private key of this public key. I will add few ways to compute public key from private key to readme.
@k06a If you're certain that this software works, the docs may need to be made more clear.
My current understanding was:
Generate keypairs using openssl ("KeyA")
Use Public KeyA as -z
parameter for Profanity2 to receive Wallet Address and Private KeyB
Generate the final wallet PK with hex((0xPrivateKeyA + 0xPrivateKeyB) % 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F)
However, the resulting key does not resolve to the wallet address as expected.
(Additionally, I would recommend enabling GitHub Issues in these early stages)
Edit for throwaway example:
$ openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c 1000 | sed 's/41534e31204f49443a20736563703235366b310a30740201010420/Private Key: /' | sed 's/a00706052b8104000aa144034200/\'$'\nPublic Key: /'
Private Key: a6bc56bc2b7e190792ae56f251f0913f000bccb227b13f5b96a953efd7ed7126
Public Key: 04ac2a194de6988e3974fe4ae59062092b1e417b4b1aa7e96ee0e5369a57afda4e44b659d9bfd6ed5aa9fde15a15432c42e387ac91033ea93c6bfe55a6e9d069aa
$ ./profanity2.x64 -z ac2a194de6988e3974fe4ae59062092b1e417b4b1aa7e96ee0e5369a57afda4e44b659d9bfd6ed5aa9fde15a15432c42e387ac91033ea93c6bfe55a6e9d069aa --leading f
[snip]
Time: 2s Score: 5 Private: 0x000005c58817b4dbfd3eab1c70100751a9832b2817adcf5a2455154a621c302e Address: 0xfffffe925f079974824f75296023557f12b50254
>>> OPENSSL_PK = 0xa6bc56bc2b7e190792ae56f251f0913f000bccb227b13f5b96a953efd7ed7126
>>> PROFANITY_PK = 0x000005c58817b4dbfd3eab1c70100751a9832b2817adcf5a2455154a621c302e
>>> hex((OPENSSL_PK + PROFANITY_PK) % 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F)
<<< '0xa6bc5c81b395cde38fed020ec2009890a98ef7da3f5f0eb5bafe693a3a09a154'
>>> web3.eth.account.from_key('0xa6bc5c81b395cde38fed020ec2009890a98ef7da3f5f0eb5bafe693a3a09a154').address
<<< '0xd4239c89a02721886b2B9e9D83A2D4B82868eF48'
Hopefully I'm simply misunderstanding something.
Issues enabled
My example:
% openssl ecparam -genkey -name secp256k1 -text -noout -outform DER | xxd -p -c 1000 | sed 's/41534e31204f49443a20736563703235366b310a30740201010420/Private Key: /' | sed 's/a00706052b8104000aa144034200/\'$'\nPublic Key: /'
Private Key: 74c4178358fdf8ec005ce13860826c19142edcd7f990133a4935453756d5b940
Public Key: 046bf592ed1cdff6b553be775e41cebd517608cef250bffe28d8814b68fc5414dace5de2b452a000cfeaeaf4ad3320f7d11187fe8ef6f0ed818808b04d1308c2e8
% ./profanity2.x64 -z 6bf592ed1cdff6b553be775e41cebd517608cef250bffe28d8814b68fc5414dace5de2b452a000cfeaeaf4ad3320f7d11187fe8ef6f0ed818808b04d1308c2e8 --leading f
...
Time: 7s Score: 6 Private: 0x00002479c6eb61b1911756d2c069e570ca139c0964abf1dd5a30d27876e2d64e Address: 0xffffffacfd74399a79feb0a25675341838f06904
% python3
>>> hex((0x00002479c6eb61b1911756d2c069e570ca139c0964abf1dd5a30d27876e2d64e + 0x74c4178358fdf8ec005ce13860826c19142edcd7f990133a4935453756d5b940) % 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F)
<<< '0x74c43bfd1fe95a9d9174380b20ec5189de4278e15e3c0517a36617afcdb88f8e'
>>> web3.eth.account.from_key('0x74c43bfd1fe95a9d9174380b20ec5189de4278e15e3c0517a36617afcdb88f8e').address
<<< 0xfFFFFfaCfD74399A79feB0A25675341838f06904
@DefiDebauchery maybe this happened to you sure very rare bugs:
Always verify that a private key generated by this program corresponds to the public key printed by importing it to a wallet of your choice. This program like any software might contain bugs and it does by design cut corners to improve overall performance.