PHP Coder Needing To Understand Litecoin API

I’m a PHP coder. I can also do C++. I work primarily with Linux servers for my coding. I’d like to build a PHP-based cart that can accept Litecoin. I’ve done cryptocurrency trading for a few years now, and talked to a few cryptocurrency APIs for getting rates and so on, but never have attempted adding a new transaction into a blockchain.

How does one add a new transaction into the blockchain with PHP and/or C++?

Or, if you think it’s going to take me like a week of solid PHP and perhaps C++ coding to get a transaction into the blockchain, and could suggest a low-cost API that I should use instead, then please do so and I’ll consider it.

On Reddit in /r/altphp, someone responded to me on this. They said basically that unless I run my own Litecoin Node, which is not so easy to do I guess, that I’m better off to use a low-cost API like and save myself the headache, time, and cost. (There are other APIs too though – DYOR.) So I went looking at that site and see that it’s 1.5% on the transaction and then you have to add in the typical LTC transaction fees which I guess is 19 cents (max avg lately) and then multiply that 19 cents x 2 because I’ll be doing a withdrawal into my own LTC account later.

1 Like

I have the same question!
How did you solve it in the end?

hei! brother !
I find a website!

Hello! Fellow PHP dev here! I’ve been hacking away at the blockchain for weeks now. The general pattern for any coin is to generate a hex instruction and then to submit the instruction to the blockchain. The latter requires a node unless you make use of a service like blockdaemon for the submission part. That is what I do.

This is what I use to generate a new Litecoin address: zamgo/PHPCoinAddress.git

      $coin = CoinAddress::litecoin();
      $wallet_private_key = $coin['private'];
      $wallet_pubic_key = $coin['public_compressed'];
      $wallet_address = $coin['public'];

As for sending, I was able to make it work with node.js/npm using this: litecore-lib but now there seems to be critical issues with the library and so I need to find another way.

I am most likely going to generate the hex submission using either the python litecoin library, or worst case, attempt it with Java. I am unable to find code to do with PHP, as I was able to find for Bitcoin/ ETC etc.

You can take help in the various forums related to this issue. You can not build a perfect Api without the help of others.