Posted on

Light Bulb Moments

Potential use cases …

  • unlock WiFI access
  • tokens with significant network effect could be used as collateral for credit extension / issuance of stablecoin
    • supply will be locked up putting upward pressure on price if demand remains unchanged
    • the reverse maybe true when the token’s underlying value proposition is challenged
Posted on

Workshop 1.1 – Install Python in Ubuntu

version details:

  • Ubuntu 18.04
  • Python 2.7 3.6.7
    • library
      • python-bitcoinlib
        • sudo apt-get install libssl-dev
        • pip install python-bitcoinlib or or pip3 install python-bitcoinlib
      • pycoin
  • Bitcoin Core 0.16.3
    • code
      • rpc_block.py
      • rpc_transaction.py
  • Text Editor
    • Nano 2.5.3
    • Leafpad
    • Sublime or equivalent

libssl-dev is needed to handle SSL and TLS cryptographic protocols

The best way to learn coding is to review examples available on the internet and referencing syntax to the official documentation – python-bitcoinlib Documentation

Let’s review 2 methods:

  • getblockhash(height)
    • Return hash of block in best-block-chain at height.
    • Raises IndexError if height is not valid.
  • getrawtransaction(txid, verbose=False)
    • Return transaction with hash txid
    • Raises IndexError if transaction not found.
    • verbose – If true a dict is returned instead with additional information on the transaction.
    • Note that if all txouts are spent and the transaction index is not enabled the transaction may not be available
  • Exercise #1:
    • design a GUI allowing for the
      • input of the blockheight
      • output of the corresponding total output (BTC)
      • GUI to have Label, grid, messagebox
    • use tkinter, bitcoin.rpc/RawProxy

The idea is to extract a list of all transaction IDs in the block. Next, to iterate through each transaction ID in the block for txid and drill down to the output.

Like so …

  • Exercise #2a:
    • design a GUI / command line interface (bitcoin-cli) to understand the following methods
      • getblockchaininfo
        • bestblockhash
      • getwalletinfo
      • getblockhash
      • getrawtransaction txid
      • decoderawtransaction
    • GUI to have
      • Label, grid, messagebox
      • tkinter, bitcoin.rpc/RawPro
  • Exercise #2b:
    • design a GUI / command line interface (bitcoin-cli) to trace the history of a particular transaction through its txid
    • determine its blockid
      • run node with txindex=1 in the configuration
        • bitcoind -reindex
        • obtain blockhash
          (use an example from the internet and verify the data points programmatically for consistency)
          • bitcoin-cli getrawtransaction [txid] 1
        • alternatively, obtain its hash by manually obtaining blockid from the internet
          • bitcoin-cli getblockhash [blockid]
          • bitcoin-cli getrawtransaction [txid] 1
            • it is equivalent to decoderawtransaction
      • get block details
        • bitcoin-cli [blockhash]
        • validate / search for a txid is recorded in the list (tx) the said block
        • verify whether the hash of the said transaction is also its txid
    • obain raw transaction of txid
      • bitcoin-cli getrawtransaction [txid]
    • decode the raw transaction
      • bitcoin-cli decoderawtransaction [ ]
    • view and interpret the details
      • txid
      • hash
      • vin
        • txid (previous transaction)
        • vout
          • can have more than 1 output
          • for this exercise the txid example has only 1 previous output
        • scripSig
      • vout
        • value
        • n
        • scripPubKey
        • address
      • tie in the values
        • Input = Outputs + Mining Fees
    • GUI to have
      • Label, grid, messagebox
      • tkinter, bitcoin.rpc/RawPro

Like so …

Posted on

Snake and Ladder



Progression, especially in the crypto space, is hardly linear. There is a tendency to overshoot – on the way up and on the way down. A conventional method in determining the value proposition will be its prevailing transacted price. In an imperfect marketplace where price discovery is poor, it is necessary to supplement technical analysis with fundamental analysis.
[ifpaid 0.0000025 BTC text=”Please pay 0.0000025 BTC to continue reading.” button=”Click here to pay using the Lightning Network”] It is from the fundamental analysis that the long term prospect of a value proposition can be more objectively assessed. This covers the key individuals championing the project, community and or ecosystem associated with the project. What is of particular interest is the stated mission (purpose in being) and vision of the project and hence the underlying core values of the key proponents – predisposed (declared) as well as exhibited. It is necessary to go down the rabbit hole to suss out the lay of the land to better appreciate the dynamics of the environment. By connecting the dots, it is possible to gain invaluable insights and to ascertain critical success factors that will sustain the project and for the project to be widely adopted in the marketplace.

The perception gap (reality versus potential) leads to poor price discovery. If the project exhibits potential and is gaining traction through key metrics, it is useful to play the long game. Short term volatility is to be expected especially if the underlying disruptive innovation is meeting robust push back from an incumbent market. Existing players are expected to put up fierce resistance even to the extent of talking down the value proposition of the said project.

Last mile gaps are particularly challenging to overcome and the ecosystem requires time leveraging on the network effect to win over the marketplace. Weak hands can be expected to drop out as they don’t make the effort to understand the intricacies of the play and are impatient for results. They come in expecting quick profits and when disappointed will exit just as quickly. When market penetration is expected to take years, price volatility in the short term is to be expected and here in lies the opportunity – snake and ladder game.



Posted on

Let’s Get Started

A place to get your hands dirty. So let’s roll up our sleeves and get underway. It will be messy and we are likely to be all over the shop and hoping to find a path of least resistance. Before going wild like kids in a candy store, a little order is good to have – to serve as a check to our progress.

There is this SMART objective – Specific – Measurable – Attainable – Realistic – Timely. Instead of viewing this as stifling creativity, we should embrace it as our friend keeping us stay focus and ensuring the sustainability of the initiative(s).

We will for a start keep to a general goal ( oxymoron – yes/no?) – how to get to writing the first code that resembles some form of lightning network application (LApp).

First, we need to find the resources and ingredients to get us there …

Next, we can proceed to the installation stage.

We are making the assumptions that we have installed the following resources: i.e. Linux on Raspberry Pi 3 B (Debian)

  • is 16 GB SD card space adequate?
  • is hard disk storage space required?

We will install:

  • Go – lnd is written in Go
    • set$GOPATH environment variable – represents the path to the workspace
  • LND –
    • specify a chain backend
    • pruned or full node

Please proceed to Workshop 1 – Lightning Node Setup on the how to install.

We will also document (with continuous updating) what constitutes key success factors:

  • a site to hold domain know-how
  • gathering a team of collaborators
    • in social interactions, shared values are crucial as well as communication skill
    • documentation is part of communication skill – solving a byzantine general problem i.e. how do we trust the signal so that when we execute it will not be in vain
    • it is good to be up-front on beliefs and behaviors
    • win-win is underpinned by game theory and it is about growing the economic pie first before sharing
    • values such as care and empathy are little understood and less so, practiced
      • individuals that are inherently sad, characterless and or lacking wisdom will have a huge wall to climb before been able to have positive impacts in the community
      • a special category of not invented here personalities will be challenged to have shared values – such self centricity can point to a possible single point of failure
        • do not be blind sided – be aware of the “unknown, unknown” and defer to the expert on site to take the lead
        • be generous in sharing with such like minded experts
    • [ifpaid 0.00001 BTC text=”Please pay 0.00001 BTC to continue reading.” button=”Click here to pay using the Lightning Network”]
    • timely completion of realistic milestones (including return on investment) ensures sustainability of the project
      • monetary measurement being the lowest common denominator and for now the most objective tool, for bringing individuals together to collaborate for the common good, weed out free loaders and rent seekers
      • zero tolerance and speed
        • first mover advantage means leveraging on whatever few competitive advantages a start-up may have and move forward speedily and this means collaborate-collaborate-collaborate, document-document-document
          • financial incentives (game theory)
          • solving byzantine general problems
      • self-assessment helps to stake claim that would otherwise be claimed by free loaders, rent seekers etc – everyone will claim credit, and accountability & transparency will surface double spend problem
      • there must be financial dis-incentives to deter double spending / free loading / value extraction e.g. Hashed Timelock Contracts (HTLCs) – only a fair exchange of value will ensure the sustainability of the collaboration
      • workarounds in the block-chain space can mitigate the double spend problem
      • mitigate 2 key concerns – byzantine general problem and tragedy of the common
      • be careful of fragmentation … When things get difficult, people become more insular in their thinking and they start magnifying differences instead of focusing on commonalities” ~ Andreas Antonopoulos
    • workarounds are the norm in bleeding edge projects with no right or wrong path – it is about trial & error and sussing out the path of least resistance, testing traction and gaining adoption. It is always a work in progress. Therefore in such venture, long-term commitment is necessary and it predicated on one’s beliefs and behaviors towards the mission (purpose) and vision
  • co-working space to assemble the pieces of work

Posted on

To-Dos

In this post, we hope to surface the pain points in our continuous testing of the BTC on-chain/lightning network(LN) ecosystem.

As we discover pain points, we will highlight these here for consideration by developers to come up with solutions.

Items

  1. 1 Feb 2019: LN – merchant’s LN node/channel. A merchant will need to maintain an active incoming channel that has sufficient liquidity e.g. in a Spark wallet, it will be displayed as a blue bar as “Receivable” with the corresponding amount of BTC reflected. The merchant will have to ensure that this is being topped up in order to receive payments. One of the methods is to pay out from the underlying wallet so that the “Receivable” amount will increase(topping up). Presently, the monitoring and topping up are performed manually by the merchant. This could be automated to ease the pain.
  2. 21 Feb 2019: High consumption of electricity to mine BTC block chain. It has been said that it is an energy intensive process. There are many great minds in the sustainable energy space, and it would not be a surprise if a solution to mine more efficiently is already lurking out there.
  3. Gift cards with LN BTC. How to send such cards for promotional purposes?
Posted on

Cryptocurrency – AMA

AMA means ask me anything.

Here goes:

  • Should I wish away cryptocurrency?
  • If cryptocurrency is so risky, why should I invest?
  • Does cryptocurrency have an inverse relationship with other asset classes? If so, what are the implications?
  • Is there a good explanation that cryptocurrency can improve the performance of an investment portfolio?

Perhaps by answering the above questions, individuals would be able to honestly make up their mind as to whether they want to progress further in understanding this space …

Posted on

Articulating a pain point – connectivity and routing

The last mile gap is the bottleneck preventing greater adoption.

Seeking a solution: Customer wants to use an iOS Lightning Network (LN) wallet (e.g. bluewallet) to pay to any store that accepts LN BTC.
[ifpaid 0.00001 BTC text=”Please pay 0.00001 BTC to continue reading.” button=”Click here to pay using the Lightning Network”]

The store will have a node address + LN wallet e.g. Spark/clightning (NodeAdd1). How can the store setup the routing to make it possible for the customer to make LN BTC payments without the need to open direct channel with that store?

Have opened channel between:

  • http://lndhub.io/ and the NodeAdd1 as well as
  • a well-connected hub ACINQ and NodeAdd1.

Both cases, the LN BTC payments made under the iOS wallet(s) failed to go through.

LN BTC wallet in the android space is working fine and customer is able to open direct channel to a store to make purchases.
In certain market, the market share between iOS and android is 50:50 and it will be very useful for merchants to have incoming channels from well-connected hubs to tap the iOS market.

However, in the iOS space there seems to be no possibility for customers to open channel directly.

Merchants will need to request well-connected hubs to create incoming channels so that customer using iOS LN wallets can shop at their stores without the need to open direct channel.

The first method is to send LN BTC from the store’s wallet to a well-connected hub’s designated node address and at the same time for the latter to open incoming channel back to the merchant’s wallet using its node address.

A second method is to go to a decentralized exchange where:

  • the merchant creates a channel with the exchange – you need to obtain the node address from its site
    • need to make sure there is sufficient funding available for channel opening
  • proceeds to the exchange site and exchange LN BTC to on-chain BTC
    • since the payment of the LN BTC will be from the merchant wallet, generate an invoice (for refund) from the “Request” button for the amount of bits/satoshi to be exchanged and copy the QR code or its text to the exchange form
    • select a wallet to receive the on-chain e.g. eclair>your bitcoin address, and copy that address to the exchange form
  • the exchange will then generate an invoice (QR Code and its text) for the store to make the LN BTC payment
    • from the merchant wallet, select “Pay” button and copy the QR Code or the text generated to the “Payment request” box and proceed to send
    • the exchange will provide a status report i.e. Deposit received > Exchanged > Sent with the Order ID displayed for reference /follow up
  • upon payment, the channel will re-balance and the exchange is deemed to have provided incoming capacity of the amount the store has made payment

Once the store has completed the above steps, users with iOS LN wallets can shop at the store without the need to open channel directly.

Presently, iOS LN wallets such as BlueWallet and Wallet of Satoshi are custodial (some will be view its centralized feature as a downside), and are convenient for end-users for their ease of use in accessing online stores and making payments. Both these wallets are also available for Android devices. Having tested the
Wallet of Satoshi on an Android device and from an ease of use perspective it worked like a charm. In this respect, it will be great for mass adoption for the lightning network space.

As part of the ongoing discovery, it has been observed that a merchant receiving payments will need to constantly monitor that it has sufficient incoming capacity. Otherwise, a customer making payment will encounter a failure. Also, for non-custodial LN wallet e.g. Eclair Mobile , it is still not possible to receive payments to avoid a situation where its peer publishes an old state and claiming funds that it may not be entitled to.

Posted on

Workshop 1 – Lightning Node Setup

Learning objectives:

  • to be able to setup a sandbox to learn more about LND
    • what is LND?
    • what is c-lightning?
      • why the need to install this on top of LND
    • what are the commands (cli) use for?
    • what are the use cases for the commands?
    • how to do up a simple smart contract?
  • understand what is meant by programmable money
    • give 1 to 2 examples how layer 2 BTC can be used this way
    • roll out a project to illustrate how layer 2 BTC is used this way

Resource materials:

Exercises: assuming that the setup is completed

  • Running
    • bitcoind or
    • bitcoin-qt
      can run either one (bitcoind , bitcoin-qt) not both
  • Test whether bitcoind is running
    • bitcoin-cli getblockchaininfo
    • ps|grep bitcoind
  • shutdown and power up
  • controlling services
    • Start: sudo systemctl start
    • Restart: sudo systemctl restart
    • The services names are: bitcoind,lightningd,btc-rpc-explorer,eps and spark-wallet

Questions:

  • Node address – does the TOR hide the full node address?
  • Tor Hidden Services and other – how to remote access the node and wallet in order to test out cli commands e.g.
  • Node address does not accept incoming connections – do we need to open port and expose IP? –
    • what abt TOR – what purpose does it serve?
  • Test drive commands
    • start lightningd
      • lightning/lightningd/lightningd
        • ~/lightning/cli$ ./lightning-cli []
    • lightning-cli help
      • lightning-cli newaddr
        • pay via any segwit HD (hierarchical deterministic) wallet
      • lightning-cli connect id [host] [port]
      • lightning-cli getinfo
    • hands-on example: how to send lightning payments using the terminal?
      • lightning-cli newaddr
        • Layer 1 BTC transaction
        • Bech32 – a segwit address format specified by BIP 0173)
          • bc1 format
      • lightning-cli listfunds
      • lightning-cli connect 03e5f9d1935c67a029bf0a26af5f63109f4f4c45993a8f45177a8f2f39bcb46144 77.58.162.148 9735
        • nodeId@host:port
      • lightning-cli list peers
      • lightning-cli fundchannel
      • lightning-cli listpeers
      • lightning-cli decodepay
      • lightning-cli pay
      • lightning-cli listpayments
  • Down the rabbit hole … and took a detour
    • need to take a look into bitcoin-cli and bitcoind, together with chapter 3 of Andreas Antonopoulos’ book Mastering Bitcoin
      • elliptic curve cryptography – generating the public key in Python
      • bitcoin scripts
    • using python to test drive the command-line interface (cli)

[ifpaid 0.00001 BTC text=”Please pay 0.00001 BTC to continue reading.” button=”Click here to pay using the Lightning Network”]

  • what is:
    • sudo ufw allow from 192.168.1.0/24 to any port 50002,3002,9737,22 proto tcp
Posted on

How to build vibrant communities


Building vibrant communities is tough. Individuals are driven differently and even when interests are perceived to be aligned, two issues surfaced– byzantine generals’ problem and tragedy of the commons. [ifpaid 0.0000025 BTC text=”Please pay 0.0000025 BTC to continue reading.” button=”Click here to pay using the Lightning Network”]

The approach is to break up the problem into simpler parts. First of all, the individuals. Individuals behave differently but when we can identify the pain shared by these individuals, we may be able to find a solution. Individuals will have different pain threshold and will resort to behaviours (based on their beliefs) resulting in tragedy of the commons i.e. depleting resources that are for the common use. Next we need to identify the influencers who are likely to be early adopters to the solution. These are individuals who possess the right values and beliefs that seek to minimise loss arising from the tragedy of the commons. In other words, they work for the common good of the community.

Also the solution must have a mechanism to prevent a ‘double spend’ i.e. cheating, from occurring. The idea is to have consensus so that no minority group can mount a 51% attack. This passivity (sort of) can be supplemented with tougher measures to deter bad actors.

In our experience with social outings/activities, bad actors can be prevented from double spending when there is a presence of strong leadership. Bad actors are invariably exposed and they will opt out of the ecosystem to seek greener pasture.

Individuals possessing values such as integrity, competency, care and empathy are likely to be good opinion leaders/influencers. As early adopters, these individuals will also get to share a greater piece of the pie as the network effect takes hold.

Posted on

Owning It

To solve the byzantine general problem and the tragedy-of-the-common issues, individuals are better off building community with shared values, aligned interests, and having beliefs and behaviors that allow for taking ownership of the challenges (pains) faced by the community and coming up with solutions by consensus that will serve the common good of the community.

[ifpaid 0.0000025 BTC text=”Please pay 0.0000025 BTC to continue reading.” button=”Click here to pay using the Lightning Network”]

The mission (purpose in being) is to empower individuals with the right tools to enjoy a fair exchange of values among stakeholders.

Why? future proofing your life

How? by joining and helping the community to grow and take ownership of the value proposition the project accords

When?now is as good as anytime

The present fiat-based financial system is looking dated and societies may no longer be getting more mileage out of it. Since the 2008 financial crisis, it is not difficult to discern how blunt and increasingly ineffective the tools are, and negative externalities inevitably seep into the system. The temptation to privatize profits, socialize costs is too great to pass for most mortal beings resulting in a world where imbalances abound and wealth creation is not sustainable.

An alternative approach is to allow a decentralized digital asset class to co-exist that will serve as a competitive benchmark to mitigate any unintended excesses arising from the incumbent system.

In addition, the decentralized digital asset has a very powerful feature – programmability (open source). This will empower the workforce to work hard by learning new skills to meet new challenges ahead. For smaller economies, the added attraction is that it allows ease of access to the larger global marketplace.