Skip to content

Instantly share code, notes, and snippets.

@kimsk
Created November 19, 2022 06:21
Show Gist options
  • Save kimsk/c2ea7a18fdc289df13d1d03acef7473e to your computer and use it in GitHub Desktop.
Save kimsk/c2ea7a18fdc289df13d1d03acef7473e to your computer and use it in GitHub Desktop.
Given synthetic public key and fingerprint, output the synthetic secret key
$fp = 3855208971
$synthetic_pk = "93c8a14b74d0cfe62cf451200eb42f3f2fe5c581f5153d308b10c43f40fba9d49a812204e0f970b2f83e23c59eb22e09"
$index = chia keys derive -f $fp child-key -t wallet -n 20 |
% { $_ -replace "^Wallet public key (\d{1,}): ", "" } |
% { cdv inspect keys --synthetic -pk $_ | select -first 1 } |
% { $idx =0 } { [pscustomobject]@{ index = $idx; sythetic_public_key = $_.Substring(12, 96)}; $idx++ } |
? { $_.sythetic_public_key -eq $synthetic_pk } |
% { $_.index }
chia keys derive -f $fp child-key -t wallet -i $index -s |
select -skip 1 |
% { $_ -replace "^Wallet private key (\d{1,}): ", "" } |
% { cdv inspect keys --synthetic -sk $_ | select -first 1 }
@kimsk
Copy link
Author

kimsk commented Nov 19, 2022

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment