Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for P2SH and bech32 for Litecoin #58

Open
mehranj73 opened this issue Sep 28, 2021 · 0 comments
Open

add support for P2SH and bech32 for Litecoin #58

mehranj73 opened this issue Sep 28, 2021 · 0 comments

Comments

@mehranj73
Copy link

Please add support for P2SH and bech32 address types for Litecoin. I wish I had the knowledge to do so. Maybe you can use this.

P2SH:

val key = ECKey.fromPrivate(BigInteger("12"))
val redeemScript: Script = ScriptBuilder.createP2WPKHOutputScript(key)
val script = ScriptBuilder.createP2SHOutputScript(redeemScript)
val scriptHash = ScriptPattern.extractHashFromP2SH(script)
LegacyAddress.fromScriptHash(params, scriptHash).toString()

bech32:
SegwitAddress.fromKey(params, key).toString()

All address types:

MKyc39yFiUtVBFkE7Av1iuU5GHX9eHYRrx
LfNppYBGy9fdDzFbcddJKYR2e6ZZqCfsnW
ltc1qm5gqhe7e46jhyy2ca00x66slmrlljwa340ldnq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant