bllmplugin/javadoc/bllm/Main

Main (bllm 0.1 API)
bllm

Class Main

  • java.lang.Object
    • bllm.Main


  • public class Main
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      Main() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void main(java.lang.String[] args) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Main

        public Main()
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
Share

bllmplugin/javadoc/bllm/TransactionObject

TransactionObject (bllm 0.1 API)
bllm

Class TransactionObject

  • java.lang.Object
    • bllm.TransactionObject


  • public final class TransactionObject
    extends java.lang.Object
    • Field Detail

      • block_height

        public final long block_height
      • block_index

        public final long block_index
      • hash

        public final java.lang.String hash
      • addresses

        public final java.lang.String[] addresses
      • total

        public final long total
      • fees

        public final long fees
      • size

        public final long size
      • preference

        public final java.lang.String preference
      • relayed_by

        public final java.lang.String relayed_by
      • received

        public final java.lang.String received
      • ver

        public final long ver
      • double_spend

        public final boolean double_spend
      • vin_sz

        public final long vin_sz
      • vout_sz

        public final long vout_sz
      • confirmations

        public final long confirmations
    • Constructor Detail

      • TransactionObject

        public TransactionObject(long block_height,
                                 long block_index,
                                 java.lang.String hash,
                                 java.lang.String[] addresses,
                                 long total,
                                 long fees,
                                 long size,
                                 java.lang.String preference,
                                 java.lang.String relayed_by,
                                 java.lang.String received,
                                 long ver,
                                 boolean double_spend,
                                 long vin_sz,
                                 long vout_sz,
                                 long confirmations,
                                 TransactionObject.Input[] inputs,
                                 TransactionObject.Output[] outputs)
    • Method Detail

      • getTransactionDate

        public java.lang.String getTransactionDate()
      • getConfirmations

        public long getConfirmations()
      • getDoubleSpend

        public boolean getDoubleSpend()
Share

bllmplugin/javadoc/bllm/package-frame

bllm (bllm 0.1 API)

bllm

Share

bllmplugin/javadoc/bllm/package-summary

bllm (bllm 0.1 API)

Package bllm

Share

bllmplugin/javadoc/bllm/TransactionObject.Output

TransactionObject.Output (bllm 0.1 API)
bllm

Class TransactionObject.Output

  • java.lang.Object
    • bllm.TransactionObject.Output
  • Enclosing class:
    TransactionObject


    public static final class TransactionObject.Output
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.lang.String[] addresses 
      java.lang.String script 
      java.lang.String script_type 
      long value 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Output(long value, java.lang.String script, java.lang.String[] addresses, java.lang.String script_type) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String[] getAddresses() 
      long getValue() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • value

        public final long value
      • script

        public final java.lang.String script
      • addresses

        public final java.lang.String[] addresses
      • script_type

        public final java.lang.String script_type
    • Constructor Detail

      • Output

        public Output(long value,
                      java.lang.String script,
                      java.lang.String[] addresses,
                      java.lang.String script_type)
    • Method Detail

      • getAddresses

        public java.lang.String[] getAddresses()
      • getValue

        public long getValue()
Share

bllmplugin/javadoc/bllm/UnlicensedPanel

UnlicensedPanel (bllm 0.1 API)
bllm

Class UnlicensedPanel

  • java.lang.Object
    • java.awt.Component
      • java.awt.Container
        • java.awt.Window
          • java.awt.Frame
            • javax.swing.JFrame
              • bllm.UnlicensedPanel
  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants


    public class UnlicensedPanel
    extends javax.swing.JFrame
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      javax.swing.JLabel confirmationsLabel 
      • Fields inherited from class javax.swing.JFrame

        accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Frame

        CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      UnlicensedPanel(DialogLicenseManager _parent, boolean _useTrialBanner, int _trialExpiresInDays, double _requestedPayment, java.lang.String _unitsOfRequestedPayment, java.lang.String _merchantWalletID, java.lang.String _licenseID, long _requiredConfirmations, int _expiresInHours, LicenseManager _lm, java.lang.String _title) 
    • Method Summary

      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • confirmationsLabel

        public javax.swing.JLabel confirmationsLabel
    • Constructor Detail

      • UnlicensedPanel

        public UnlicensedPanel(DialogLicenseManager _parent,
                               boolean _useTrialBanner,
                               int _trialExpiresInDays,
                               double _requestedPayment,
                               java.lang.String _unitsOfRequestedPayment,
                               java.lang.String _merchantWalletID,
                               java.lang.String _licenseID,
                               long _requiredConfirmations,
                               int _expiresInHours,
                               LicenseManager _lm,
                               java.lang.String _title)
Share

bllmplugin/javadoc/bllm/package-tree

bllm Class Hierarchy (bllm 0.1 API)

Hierarchy For Package bllm

Class Hierarchy

Share

BLLM License Key Generator

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.

Share

Bitcoin/Litecoin wallet ID generation

For an introduction to the Bitcoin/Litecoin License Manager, read this post. I will use Litecoin wallet ID generation in this example, but the steps are the same for Bitcoin.

Litecoin wallet installation

There are numerous ways to work with Litecoin, including using the core software directly. I recommend Electrum-ltc, a lightweight, deterministic brain wallet. Use Electrum for bitcoin. Follow the installation directions, generate your seed, then generate a bunch of Wallet IDs, as many as you would like to generate Litecoin Licenses for. Go to the Electrum console and type the command listaddresses() to get the following view:

These addresses can now be copied into a text file, one wallet ID per line. Do not include quotes or other special characters (beware of blank spaces) so remove them with find/replace. The final file should look like:

walletids.txt
1
2
3
4
5
6
7
8
9
10

LNHcyCddhGn6WeMg9kK6kAUEVMgUzcaNTj
LT3mYRc9r7aH75AKi1sJNF1DAcnUGceBeE
LYSZ5tShMZXinQJeziNCb3nQohHhxdSgNS
LUjzVxJet4fbk6Vj8nGjkWieV5L2HFqcmB
LWPw8duwhe9oEK3EU5MQui9rXeEV9NTKF8
LYyUQG3c6tohhyE5cYCw6jdyxsee2wyryf
LSXV7tUc31fq6QYRjXmo1ojWnfNBji67B4
LTWW9W8C8Fc6eeyYJUdWafnG6ZjMw3fTSm

Once you have generated a wallet IDs file, you are ready to move on to the next step, which is generating a license key file for each wallet ID using the Bitcoin/Litecoin Licence Manager Licence Key Generator.

Share

Bitcoin/Litecoin License Manager

Introduction

The Bitcoin/Litecoin License Manager is a Java plug-in that will allow you to non-interactively collect software licensing fees from your customers using the cryptocurrencies Bitcoin or Litecoin. Give the banksters and rentier-wannabes (e.g. Stripe, PayPal) the finger and take charge of your own finances. Why pay their fees and risk deplatforming at their whim?

You may want to consider Litecoin instead of Bitcoin. Why?:

  • Availability: Litecoin is available on most exchanges and is readily exchanged for Dollars or Bitcoin. Check out Coinbase, which also provides you with a wallet.

  • Wallets: Multiple wallets are available. My favorite is the lightweight, deterministic brain wallet Electrum

  • Low volatility relative to Bitcoin.

  • Faster transaction times relative to Bitcoin. A block ascceptance time of 2.5 minutes relative to Bitcoin’s 10 minutes.

  • Lower transaction fees relative to Bitcoin. A recent $99 million Litecoin transaction took 25 minutes and cost 40 cents in fees.

  • Litecoin also has an increased maximum number of coins 84,000,000 vs. Bitcoin’s 21,000,000 and a different hashing algorithm - scrypt vs. SHA-256.

A Bitcoin/Litecoin License encapsulates a variety of parameters such as license expiration date, number of transaction confimations required, transaction expiration, etc. that allow you to balance ease of Licence attainment with security. Utilizing the Bitcoin/Litecoin License Manager is a three step process:

  1. Set up your Bitcoin or Litecoin Wallet and generate wallet IDs.

  2. Use the Bitcoin/Litecoin License Manager License Key Generator to generate license keys containing your parameters of interest.

  3. Integrate the Bitcoin/Litecoin License Manager with your own software.

A video overview of the process is available on youtube:

Share