BitcoinECDSA.php icon indicating copy to clipboard operation
BitcoinECDSA.php copied to clipboard

How to tweak this library for Litecoin?

Open themohitmadan opened this issue 6 years ago • 4 comments

Hi,

I'm working on a project where I'd be using your codebase :)

I was wondering if it can be tweaked for LTC addresses?

My use-case is to convert hexa private key to wallet address

themohitmadan avatar Oct 10 '19 06:10 themohitmadan

Mainly, it would just require replacing the sha256 hash function with the scrypt one

rgex avatar Oct 10 '19 09:10 rgex

So either using this solution https://github.com/cmpscabral/cryptobits/tree/master/php/scrypt or this one https://github.com/DomBlack/php-scrypt

rgex avatar Oct 10 '19 10:10 rgex

Scrypt has nothing to do with it. In the constructor you have to change networkPrefix from '00' to '30' and in getPrivatePrefix() change return from '80' to 'b0'.

ErikPelli avatar Dec 04 '19 14:12 ErikPelli

My mistake then, I believed they were using Scrypt to generate the address.

rgex avatar Dec 04 '19 14:12 rgex