Before using the Bitcoin/Litecoin License Manager License Key Generator you need to have produced text file of wallet IDs. Read how to generate this file here.
License Key Generation
A license key is a serialize Java License object. Code for the License object can be found in the License.java file. This object contains various parameters that you the developer (also referred to as the “merchant” in the code) will set. To make setting parameters and serializing License objects easy, I have written an app that will collect the parameters and serialize them into a cryptographically secure License object for you. Here is the main interface when using Litecoin:
Here is a table of the various License parameters and their usage:
Parameter |
Description |
Wallet ID |
Your (the developer’s) Litecoin wallet ID, into which you would like the licensing fees for your software deposited |
Transaction ID |
The transaction ID from the Litecoin blockchain that supplied your wallet with the licensing fees |
Transaction date |
Date of the Bitcoin/Litecoin transfer transaction |
Confirmations |
The required number of blockchain confirmations required before trusting that the transfer has been verified by the network |
Transaction expiration |
Number of hours within which the licensee needs to confirm the transaction using the Bitcoin/Litecoin License Manager software |
License expiration |
Number of days for which the license is valid |
License cost |
Cost specified in dollars or Bitcoin/Litecoin |
Payment requested in |
The denomination you, the developer, expect as payment (Bitcoin or Litecoin). |
Using the “Select the file…” button select your wallet ID file. The License key generator will attempt to determine whether you are working with Bitcoin or Litecoin wallet IDs and display the appropriate icon. The currency type is determined from the first letter of the first wallet ID in the wallet IDs file, using the following table:
First letter |
Wallet type |
1 |
Bitcoin |
L |
Litecoin |
3 |
Multisig |
M |
Multisig |
If you are working with a multi-sig wallet (3 or M), you will be prompted to indicate Bitcoin or Litecoin. Select the other parameters and push “generate”. You will find a new license directory inside the directory holding you wallet ID files. Each file is inside a directory that is named with the last eight characters of the wallet ID. All wallet IDs in a single file must be of the same type i.e. have the same first character.
Once licenses have been generated you can inspect the parameters of a serialized file using the inspector tab of the License Key Generator:
If you specified the cost in dollars, the expected currency of payment is indicated, but not the amount. The amount will be calculated at the time of licensing, using current valuations. For this reason (amongst others) the user needs to be connected to the internet during the licensing process.
A goal of the Bitcoin/Litecoin License Manager is to allow you the developer to non-interactively collect licensing fees for your software. Since there are no third party arbitrators of disputes, any issues that arise will force an interaction between you and your customers. Therefore you want the process to be as easy as possible while at the same time discouraging cheating on the part of the users. A few scenarios are outlined below, with increasing security, but also placing more burden on the customer.
Scenario I: Shareware with the opportunity for donations
Confirmations required = 0
Transaction expiration = 8760 hours ( 1 year, essentially inactivating this feature)
License expiration = 36500 days (100 years, essentially a perpetual license)
In this scenario you are using the BLLM as a means to provide the user with your wallet ID and make it easy to collect donations. If a donation is provided, the “Licensed” panel will display for the user.
Scenario II: Trial period
Confirmations required = 3
Transaction expiration = 48 hours
Trial expiration = 14 days
License expiration = 365 days
You are providing the user with 14 days to evaluate your software. At the end of 14 days the licensed flag is set to false and the software is locked down. A payment will unlock the software for 365 days. After 365 days have passed, a new payment will provide an additional 365 days of license.
Scenario III: Feature lock down
Similar to above only rather than locking down the entire application, only certain features are locked down by checking the value of LicenseManager.getLicenseStatus()
Notes on parameters
Number of confirmation required: Generally 3 is considered good to avoid double spending. 6 would be high security. 0 is for the ease of use for the customer as it would require no waiting.
Transaction expiration in hours: Requires the customer to confirm the transaction within X number of hours. 8760 hours (1 year) is for ease of use. Use small values if you have multiple geographically colocalized (same company) customers who might make a single payment used to confirm multiple licenses. A limited time window for confirmation prevents users from scanning the blockchain for transfers to your wallet and using those transfers to validate their license. Avoid this possibility by giving each user a separate wallet ID and setting transaction expiration to 8760 hours.
Java Web Start
If you have Java 1.8 installed and security is properly configured, you can run the License Key Generator as a Web Start application by clicking here. Otherwise download the jar from github. Javadocs are available here.
You are ready now to integrate the license plugin with your application.