dogecoin / dogecoin/libdohj

add support for P2SH and bech32 for Litecoin

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
126
Forks
95
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/pokkst/litecoinj).

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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.