Understanding Bitcoin Transaction Structure: Legacy and Witness Versions

Posted on

Bitcoin transactions are the backbone of the Bitcoin network, facilitating the transfer of value. Understanding their structure is essential for anyone interested in blockchain technology. This article delves into the details of both legacy and witness (SegWit) transaction structures. Basics of Bitcoin Transactions A Bitcoin transaction comprises inputs and outputs. Inputs are sources of funds,
Read more

Proving Ownership of BTC Multisig Addresses

Posted on

Proving ownership of a Bitcoin (BTC) address is a crucial aspect in various scenarios. The post Proof of Ownership for BTC Addresses introduced the proof for non-multisig addresses. This guide explores how to prove ownership for different multisig BTC address types, including algorithm specifications and step-by-step methods. What is a Multisig Address? A Bitcoin multisig
Read more

Proof of Ownership for BTC Addresses: A Detailed Guide

Posted on

Proving ownership of a Bitcoin (BTC) address is a crucial aspect in various scenarios, such as verifying identity in a transaction or demonstrating holdings without revealing private keys. This guide explores how to prove ownership for different BTC address types, including algorithm specifications and step-by-step methods. BTC Address Types P2PKH (Pay-to-Public-Key-Hash) P2SH (Pay-to-Script-Hash) P2WPKH (Pay-to-Witness-Public-Key-Hash)
Read more

Multisig 101

Posted on

Multisig, short for “multisignature,” is a cryptographic mechanism that requires multiple signatures to authorize and execute a transaction. What is Multisig Multisig ensures that multiple parties must collaborate and approve a transaction before it can be deemed valid. It provides an additional layer of security requiring multiple parties’ signatures to spend or transfer the crypto
Read more

3 Ways of .odt to .txt File Conversion in Command Line in Linux

Posted on

The Open Document .odt files can contain rich formats for the content. However, some times a plain text file is more handy. We may convert .odt files to plain text files for such needs. In this post, we discuss 3 ways of how to convert .odt files to .text files in command line in Linux.
Read more

Add Inline Comments for Multi-line Command in Bash Script

Posted on

In Bash script, it is common that multiple small commands run together connected by pipes (|) and the whole command is quite long. For clarity, we may write the command in multiple lines. How to add comments for these long multi-line commands? In Bash, the content after # in a line is the comment. Using
Read more

How to Match Multiple Lines using Regex in Perl One-liners

Posted on

Perl one-liners with perl’s regular expression statement can be a very powerful text processing tools used as commands in a terminal or a script. By default, the input to the perl one-liner with -p or -n options is passed line by line. However, when we want to match multiple lines, it gets us some trouble.
Read more

How to Query Transaction By ID in Hyperledger Fabric 2.0

Posted on

Querying transaction content out from a blockchain network is a common practice used by common scenarios like exploring the blockchain history or verifying the blockchain transaction content from a known ID. In Hyperledger Fabric, the transaction can be queried using a special system chaincode QSCC (Query System Chaincode) which is for ledger and other Fabric-related
Read more

How to Install Hyperledger Fabric 2.0 in Ubuntu 18.04

Posted on

Hyperledger Fabric is a consortium blockchain system. It’s performance is relatively good and its modular architecture enables it to be usable in many scenarios. Hyperledger Fabric itself has rich documents and samples of test networks. For beginners, deploying a new network for trying and testing still consumes quite some time. In this post, we will
Read more

How to Install Go 1.13.x on Ubuntu 18.04

Posted on

In Ubuntu 18.04 LTS, the default Go lang version is 1.10. For compatibility reason, the Ubuntu LTS will usually keep the major release version numbers for packages. However, many applications, such as Hyperledger Fabric 2.0, require a newer version of Go. In this post, let’s take a look at how to install a system level
Read more

Bash Learning Materials

Posted on

Bash (GNU Bourne-Again SHell) the default shell for many Linux distributions. It is very common for scripting languages in Linux. Bash is easy and straightforward for writing small tools. However, as most tools, it has its grammars that could easily cause bugs if they are not used correctly. Here I summarize a list of good
Read more

How to Install Wine 32-bit on CentOS 8

Posted on

Since version 7, RHEL and CentOS only have 64 bit versions. For some reasons, it’s better to run many Windows applications under 32 bit wine. Like How to Install Wine 32-bit on CentOS 7, this post introduce how to install 32-bit Wine on CentOS 8. Most of the mechanisms are similar yet there are differences.
Read more

How to get the full path and directory of a Python script itself?

Posted on

In a Python script, how to get the full path and directory of the Python script itself? To get the path of the current file (the script itself), you can use __file__. To resolve any symbolic links in the path, you can use os.path.realpath(). Putting them together, you can do os.path.realpath(__file__) to get the full
Read more

How to judge whether its STDERR is redirected to a file in a Bash script on Linux?

Posted on

Within a Bash script, how to judge whether its STDERR is redirected to a file in Bash on Linux? For example, ./script.sh /tmp/log 2>&1 Can script.sh detect that its STDERR is redirected? Knowing the destination file is better. To test whether a script’s STDERR (or STDOUT) is redirected to a file, check by [[ -f
Read more

How to add a prefix string at the beginning of each line in Bash shell script on Linux?

Posted on

How to add a prefix string at the beginning of each line in Bash shell script on Linux? For example, assume we have a file a.txt: line 1 line 2 I want to have, pre line 1 pre line 2 You may use sed, the stream editor for filtering and transforming text: sed -e ‘s/^/pre
Read more

Killing Running Bash Script Process Itself and All Child Processes In Linux

Posted on

In Linux, how to kill a process and all its child processes? For example, a Bash script A starts B, B starts C and C calls rsync. I would like to kill A and all its child processes all together. How to do this? There are possibly many answers to this question. One of the
Read more

How to delete or get the number in the tail from a string in shell script?

Posted on

How to delete or get the number in the tail from a string in shell script (bash script)? Okay to call other tools. For example, from “/dev/sda8”, I want to get “/dev/sda” and “8” separately. This can be achieved by using sed as follows. To get the string after deleting the tailing numbers, we can
Read more