blockchain Archives - ProdSens.live https://prodsens.live/tag/blockchain/ News for Project Managers - PMI Thu, 23 May 2024 13:20:51 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://prodsens.live/wp-content/uploads/2022/09/prod.png blockchain Archives - ProdSens.live https://prodsens.live/tag/blockchain/ 32 32 Vyper beginner’s tutorial: Variables. https://prodsens.live/2024/05/23/vyper-beginners-tutorial-variables/?utm_source=rss&utm_medium=rss&utm_campaign=vyper-beginners-tutorial-variables https://prodsens.live/2024/05/23/vyper-beginners-tutorial-variables/#respond Thu, 23 May 2024 13:20:51 +0000 https://prodsens.live/2024/05/23/vyper-beginners-tutorial-variables/ vyper-beginner’s-tutorial:-variables.

In our previous tutorial, we managed to write a very simple smart contract code and explained the syntax…

The post Vyper beginner’s tutorial: Variables. appeared first on ProdSens.live.

]]>
vyper-beginner’s-tutorial:-variables.

In our previous tutorial, we managed to write a very simple smart contract code and explained the syntax and structures involved. So now, let’s extend our learning to a broader spectrum by going deep into variables.

What are Variables?

In Vyper, all variables must be explicitly declared with a type. The type of a variable determines the kind of data that it can store. For example, you can declare a variable to store an unsigned integer, a string, or a boolean value.

Variable types

In Vyper, variables can be broadly categorized into two main types based on their scope and storage:

  • Local Variables
  • State Variables

Local variables:

These are temporary variables that exist only within the scope of a function. They are not stored on the blockchain and only exist in memory during the execution of the function.

Local variables are declared within functions and the variables are only accessible within the functions they are declared in.

Examples:

To better understand how variables are declared in vyper, we shall need to use a series of examples. If you look closely in the examples we provided below, all variables are declared within the function. In the following examples, our aim is to write a smart contract function for adding two numbers:

@external
def addTwo(x: int128, y: int128) -> int128:
    result: int128 = x + y
    return result

To be more concise and idiomatic:

# a simple function to add two numbers x and y
@external
def addTwo(x: int128, y: int128) -> int128:
    return x + y

We are going to divide the above code into three parts i. e;

1.

   @external
  • @external: This is a decorator that specifies the visibility of the function. It indicates that the function addTwo can be called from outside the contract. In other words, other smart contracts and external users can invoke this function. This decorator ensures that the function is part of the contract’s public interface.

2.

   def addTwo(x: int128, y: int128) -> int128:
  • def: This keyword is used to define a function in Vyper (similar to Python).
  • addTwo: This is the name of the function. It is a descriptive name indicating that the function will add two numbers.
  • x: int128: This declares a parameter x for the function. The type of x is int128, which means it is a signed 128-bit integer. In Vyper, specifying the type of each variable is mandatory to ensure type safety and prevent overflow/underflow errors.

    • int128: This type can hold values from -2^127 to (2^127) - 1. It is used for variables that need to store integer values within this range.
  • y: int128: This declares another parameter y for the function. Like x, y is also of type int128.

    • -> int128: This part specifies the return type of the function. It indicates that the function will return a value of type int128.

The truth is, Smart contracts on Ethereum are designed to be deterministic and do not interact with users in the same way traditional programs do. Therefore, to be able interact with our contract, we need some other tool and that is web3.py. If you don’t know how to use web3.py library, please visit my tutorial here and it will be helpful.

my_contract.py file:

from web3 import Web3

# Connect to a local or remote Ethereum node
web3 = Web3(Web3.HTTPProvider('https://data-seed-prebsc-1-s1.binance.org:8545/'))  # or your Infura endpoint, etc.

# ABI of the compiled Vyper contract
abi = [
    {
        "type": "function",
        "name": "addTwo",
        "stateMutability": "nonpayable",
        "inputs": [
            {
                "name": "x",
                "type": "int128"
            },
            {
                "name": "y",
                "type": "int128"
            }
        ],
        "outputs": [
            {
                "name": "",
                "type": "int128"
            }
        ]
    }
]


# Address of the deployed contract
contract_address = web3.to_checksum_address('YOUR_CONTRACT_ADDRESS')  # replace with your contract's address

# Create a contract instance
contract = web3.eth.contract(address=contract_address, abi=abi)

# Call the addTwo function
def call_addtwo():
    try:
        x = int(input('Enter X value: '))
        y = int(input('Enter Y value: '))
        result = contract.functions.addTwo(x, y).call()
        print(f"The result of {x} + {y} is: {result}")
    except ValueError:
        print('Invalid input. Please enter valid integers for X and Y.')
    except Exception as e:
        print(f'Error during addition: {e}')

# Call the function to get user input and add the numbers
call_addtwo()


And then, run your file and you should get something similar to this:

Terminal results

State Variables

These are stored on the blockchain. They are part of the contract’s state and are persistent across function calls and transactions.
State variables are declared outside of functions, typically at the top of the contract. They are accessible by all functions within the contract and are stored in the contract’s storage. Let’s have an example to better understand this:

# Define a public variable to store the greeting
greeting: public(String[100])

# Constructor to initialize the greeting
@external
def __init__():
    self.greeting = "Hello, World"

# Function to set a new greeting
@external
def set_greeting(new_greeting: String[100]):
    self.greeting = new_greeting

# Function to get the current greeting
@external
@view
def get_greeting() -> String[100]:
    return self.greeting

Here is the detailed explanation of our code:

# Define a public variable to store the greeting
greeting: public(String[100])

  • greeting: This is a state variable defined with the type String[100].

    • State Variable: This variable is stored on the blockchain, which means its value persists across transactions.
    • public: The public keyword makes this variable accessible from outside the contract, creating an automatic getter function.
    • String[100]: As already mentioned in previous examples, this specifies that the variable is a string with a maximum length of 100 characters.
@external
def __init__():
    self.greeting = "Hello, World"

  • init(): This is the constructor function of the contract, called once when the contract is deployed.

    • self.greeting = "Hello, World": This initializes the greeting state variable with the string “Hello, World”.
@external
def set_greeting(new_greeting: String[100]):
    self.greeting = new_greeting

  • set_greeting(new_greeting: String[100]): This function allows the greeting to be updated.

    • new_greeting: String[100]: The function takes one parameter, new_greeting, which must be a string with a maximum length of 100 characters.
    • self.greeting = new_greeting: This updates the greeting state variable with the new value provided.
@external
@view
def get_greeting() -> String[100]:
    return self.greeting

  • get_greeting() -> String[100]: This function returns the current value of the greeting variable.

    • @view: This is one of the available but optional decorators. It indicates that the function does not modify the state of the contract (i.e., it is a read-only function).
    • return self.greeting: This returns the value of the greeting state variable.

I am very sure now you purely get the context of variables as used in vyperlang. Let’s do one more last part of interacting with our smart contract using web3.py library.

Please note that in the following example, we didn’t use environment variables for the sake of brevity. But, i would recommend not to expose your variables by creating a .env file for them.

import sys
from web3 import Web3

# Connect to BSC node (Binance Smart Chain)
bsc_node_url = 'https://data-seed-prebsc-1-s1.binance.org:8545/'  # Replace with your BSC node URL
web3 = Web3(Web3.HTTPProvider(bsc_node_url))

# Set the private key directly (For demonstration purposes only, do not hardcode in production)
private_key = 'YOUR_PRIVATE_KEY_HERE'  # Replace with your actual private key
account = web3.eth.account.from_key(private_key)

# Contract ABI
contract_abi = [
    {
        "type": "constructor",
        "stateMutability": "nonpayable",
        "inputs": []
    },
    {
        "type": "function",
        "name": "set_greeting",
        "stateMutability": "nonpayable",
        "inputs": [
            {
                "name": "new_greeting",
                "type": "string"
            }
        ],
        "outputs": []
    },
    {
        "type": "function",
        "name": "get_greeting",
        "stateMutability": "view",
        "inputs": [],
        "outputs": [
            {
                "name": "",
                "type": "string"
            }
        ]
    },
    {
        "type": "function",
        "name": "greeting",
        "stateMutability": "view",
        "inputs": [],
        "outputs": [
            {
                "name": "",
                "type": "string"
            }
        ]
    }
]

# Contract address
contract_address = web3.to_checksum_address('YOUR_CONTRACT_ADDRESS')  # Replace with your contract's address

# Create contract instance
contract = web3.eth.contract(address=contract_address, abi=contract_abi)

# Function to get the current greeting
def get_greeting():
    return contract.functions.get_greeting().call()

# Function to set a new greeting
def set_greeting(new_greeting):
    nonce = web3.eth.get_transaction_count(account.address)
    tx = contract.functions.set_greeting(new_greeting).build_transaction({
        'chainId': 97,  # BSC testnet
        'gas': 3000000,
        'gasPrice': web3.to_wei('5', 'gwei'),
        'nonce': nonce,
    })
    signed_tx = web3.eth.account.sign_transaction(tx, private_key)
    tx_hash = web3.eth.send_raw_transaction(signed_tx.rawTransaction)
    receipt = web3.eth.wait_for_transaction_receipt(tx_hash)
    return receipt

# Main execution
if __name__ == "__main__":
    if len(sys.argv) < 2:
        print("Usage: python3 interact_with_greeting_contract.py  []")
        print("Actions: get, set")
        sys.exit(1)

    action = sys.argv[1]

    if action == "get":
        print("Current greeting:", get_greeting())
    elif action == "set":
        if len(sys.argv) < 3:
            print("Usage: python3 interact_contract.py set ")
            sys.exit(1)
        new_greeting = ' '.join(sys.argv[2:])
        receipt = set_greeting(new_greeting)
        print("Transaction receipt:", receipt)
    else:
        print(f"Unknown action: {action}")
        sys.exit(1)

Results

Vs code terminal
From the result image above, you can see that when we initially ran the get command, we got the expected Current greeting: Hello, World.

Then, when we go on to run the set command with the string set to “Good Morning Everyone!”, we do get the same expected result when we run the get command; Current greeting: Good Morning Everyone!

If you found this article helpful, please give me a heart, follow and I will be happy for any interactions in the comments section. Thank you!

The post Vyper beginner’s tutorial: Variables. appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/05/23/vyper-beginners-tutorial-variables/feed/ 0
5 Selected Platforms To Find Web3 Jobs In 2024 https://prodsens.live/2024/04/28/5-selected-platforms-to-find-web3-jobs-in-2024/?utm_source=rss&utm_medium=rss&utm_campaign=5-selected-platforms-to-find-web3-jobs-in-2024 https://prodsens.live/2024/04/28/5-selected-platforms-to-find-web3-jobs-in-2024/#respond Sun, 28 Apr 2024 12:20:30 +0000 https://prodsens.live/2024/04/28/5-selected-platforms-to-find-web3-jobs-in-2024/ 5-selected-platforms-to-find-web3-jobs-in-2024

The long-awaited crypto/web3 bull run is here and it’s truly an awesome time to be in the web3…

The post 5 Selected Platforms To Find Web3 Jobs In 2024 appeared first on ProdSens.live.

]]>
5-selected-platforms-to-find-web3-jobs-in-2024

The long-awaited crypto/web3 bull run is here and it’s truly an awesome time to be in the web3 space.

With Bitcoin hitting a new all-time high of over $70K, and the general web3 space doing quite well for a while now, the potential
of getting hired as a blockchain/web3 professional is now higher.

Whether you’re from a technical web3 background or not, this is a great time to put your acts together and make the best
of all your efforts towards securing your next web3 job.

In this article, I’m listing out 5 carefully hand-picked web3 platforms where you can find web3 jobs in 2024. These platforms
were carefully selected based on different relevant criteria to prevent this article from becoming just another spam “X platforms to find web3 jobs” article.

Below are the “5 Selected Platforms to help you find web3 jobs in 2024”.

1. Web.career

screenshot from the web3.career website

Web3.career is a web3 jobs platform that I’ve been using personally.

Somehow, this platform has made itself a stand-out platform when it comes to finding web3 jobs. It’s Probably the most popular web3
jobs platform currently available.

Even though I generally haven’t had the best experience with using the platform, I trust that it’s still one of the best platforms to
help you find your next web3 job in 2024.

Do check it out and explore your chances.

Link: Web.career

2. CryptoJobsList

screenshot from the CryptoJobsList website

CryptoJobsList, is one of the most impressive web3 jobs platforms you will find out there. From a beautiful user interface to the
highly professional service offerings on the platform, CryptoJobsList almost made it to number 1 in this article.

There’s even more.

The platform goes way beyond with a dedicated Telegram channel(currently having over 10K subscribers). With Telegram,
you can certainly receive notifications about new job postings all on the go.

You can also find links on the platform to help you access their bot provisions for Telegram and Discord.

In all, CryptoJobsList is one of the best platforms to help you get a web3 job as fast and as conveniently as possible.

I highly recommend CryptoJobsList.

Link: CryptoJobsList

3. Wellfound(Web3)

screenshot from the Wellfound website

I bet you never knew that Wellfound(formerly “AngelistList Talent”) has a dedicated web3 section on their web platform.

Well, now you know!

Wellfound remains one of the most popular and well-established job platforms on the planet. With a section dedicated to web3, this helps streamline your search and makes the process of finding web3-only jobs much easier compared to a platform like Linkedin.

Wellfound boasts of helping top web3 companies like Opensea and Uniswap, in building
their engineering teams. Wellfound is definitely one of the best platforms to try out if you wish to find a top web3 job in 2024.

Link: Wellfound(Web3)

4. Calyptus

screenshot from the the Calyptus website

Calyptus is another web3 platform to help you find your next web3 job in 2024.

Beyond just jobs, Calyptus is a more vast platform that provides educational support by providing various web3 resources to users.

I added Calyptus to this list thanks to how active the platform is with regards to hiring on Linkedin.

You can also follow Calyptus on Linkedin to increase of your chances of securing that next web3 role.

Wishing you all the best.

Link: Calyptus

5. LinkedIn

Image description

And yes, LinkedIn made it into the list.

LinkedIn remains one of the best platforms to find web3 jobs at the moment. The most important
point that accounts for that is the fact that LinkedIn is the most popular professional/job-based social media platform currently
available. By effectively combining the ability to easily connect with the recruiter/job poster, You can easily apply cold-emailing
strategies and further increase your chances of getting hired.

LinkedIn might not be the perfect place to find the most web3 jobs, but it certainly remains one of the most important.

Go ahead and hop on Linkedin, build your profile, connect with other professionals in the web3 space, and engage and apply for jobs.

Wishing you all the best.

Link: Linkedin

Conclusion

There you have it folks – “5 awesome platforms to help you find web3 jobs in 2024”.

I’m confident that this article will be one you remember as a result of how it enabled you explore the web3 jobs platform that finally lands you your next web3 role.

I hope it does.

Thanks for reading.

Cheers!!!

The post 5 Selected Platforms To Find Web3 Jobs In 2024 appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/04/28/5-selected-platforms-to-find-web3-jobs-in-2024/feed/ 0
Bitcoin Whitepaper but easier https://prodsens.live/2024/04/27/bitcoin-whitepaper-but-easier/?utm_source=rss&utm_medium=rss&utm_campaign=bitcoin-whitepaper-but-easier https://prodsens.live/2024/04/27/bitcoin-whitepaper-but-easier/#respond Sat, 27 Apr 2024 18:20:58 +0000 https://prodsens.live/2024/04/27/bitcoin-whitepaper-but-easier/ bitcoin-whitepaper-but-easier

While the entire world was busy being amused by the infamous Balloon Boy incident, the tech world was…

The post Bitcoin Whitepaper but easier appeared first on ProdSens.live.

]]>
bitcoin-whitepaper-but-easier

While the entire world was busy being amused by the infamous Balloon Boy incident, the tech world was also amused by the invention of Bitcoin or to say more precisely, the creation of Web3 i.e Blockchain Technology by Satoshi Nakamoto, who might be a person or several people or maybe even aliens because the identity of this thing has not been recognised yet. SN (short for Satoshi Nakamoto and also my initials hehe) introduced the technology by releasing a Bitcoin Whitepaper which, in my opinion, is hella confusing, so I am here to simplify it for you(I hope I don’t confuse you even more :p)

What’s the basic concept behind Bitcoin?

When the internet was introduced, everyone expected that it would help to get rid of the 2 most important flaws of day-to-day lives, first being the presence of a middleman in anything and EVERYTHING and the second being the lack of trust. I mean, will you ever trust random news on the internet OR are the middlemen that are interfering in our personal lives in the pretext of navigation, reliable? Thus, to solve these problems and to be honest many others, blockchain technology was introduced.

Blockchain technology is what forms the backbone of Bitcoins (yes, blockchain and bitcoin are 2 different things, we will get to that later). BT (not the Bad Trip one dumbo) works on the solid idea of peer to peer version of a system where a transaction happens between only two parties, yeshhhh no interference by any GIANTS aka middleMAN. Every transaction is added to a chain of blocks (imagine a train’s design for better visualization) that has been validated by numerous nodes, if these large numbers of nodes are not trying to attack the network, they will create the longest possible chain and will win against the attackers hehe. These long chains are not only proof of the sequence of events, but also proof that it has been generated by a pool of majority CPUs. The nodes participating can leave the system anytime they want and when they want to rejoin they can just refer to the longest chain to understand what happened while they were gone

The role of financial institutions in transactions

Every time you make a transaction, say for example you bought some anime merch via an online website, the process of transaction is navigated by a financial institution. This system works well for a small-scale transaction, but we can’t forget the trust issues that are prevailing. Also, every time there’s a dispute in the transaction, say the other party did not receive the money, this third party (mostly a bank) has to interfere to fix the problem, which increases the cost of the transaction. Meanwhile, if reversibility of the transaction is possible, the trust within the system increases. The presence of middlemen increases the need for users to give away their personal information, sometimes that information is asked that isn’t even required.

How to kick these financial institutions out (such parasites eww)

See the solution is simple, introducing a system with no central authority, or to be more precise we need a decentralised payment system. And how is this possible? Well, what if two parties directly communicate with each other and the trust of the transaction relies on cryptographic proof? This system will protect the seller and the buyers as well using different mechanisms which we will discuss later on. This system will be secure until it is in the power of the majority of CPUs that are legit and not the attacker nodes.

How do Transactions Shake, Rattle, and Roll in BT

In BT, when a transaction has to be made, an electronic coin is assigned as a chain of digital signatures. Now how can a user (sender) send this coin to another user (receiver), two components are required to do so, the first being signing a hash of the previous transaction and the other being the public key of the next owner.

Alright lemme explain to you what hashing and public key are before going further

Hashing happens when a transaction is broadcasted to the network, the data is converted into a fixed-length string called hash. Now this hash function uses the transaction data as the input and provides an output which severe as a digital footprint of the transaction.

The public key belongs to both the sender and receiver. Everyone in the BT network has their own public key and private key. Let’s assume that the public key is a lockbox which is shared within the network but the key (private key) isn’t. Now the users can send messages or money using this public key as a reference and the receiver uses their private key for their account.

Once the transaction is made, it has to be logged into the end of the coin. The receiver can check the previous ownership by using the signatures.

However, one of the issues with this process is that the payee (receiver) cannot check if the sender has double-spend or not. Oh wow, now what is double-spend? Ok so for example You have 5 bitcoins, and you want to send 2 bitcoins to Teddy and Bear each and alsooo you don’t wanna spend 4 bitcoins. So you use your clever mind and send 2 bitcoins to Teddy and before the transaction is logged into the network you send 2 bitcoins to Bear ehehehe, which means you just tricked the system and used the same 2 bitcoins twice and your balance now is 3 bitcoins instead of 1.

To solve the issue, a central authority which will check every transaction, which defies the main logic of BT. (We BT people HATE banks). Now to make sure that double spend does not occur is to be aware of all the transactions, one way to do so is to make every transaction public in the network. Also, the payee needs to approve that at the time of each transaction, the majority of nodes should agree it was the first received.

[hi]

Timestamp Server:- The Killer of Double-Spend

Now BT has a very amazing solution for double-spending. Now, this timestamp works by using the hash of the block of items that has to be timestamped and then publishing this hash over newspaper or Usenet(It is a worldwide-distributed discussion system available on computers). Whenever someone tries to double spend the system can detect it via the hash, coz if the transaction has entered the hash then it must have happened before, right? Now these timestamps also include the previous hash, forming a chain which has the information about the previous transactions.

hi

Mining Mastery: Understanding Proof of Work

We just discussed the timestamp server, right? Now to implement this we need a system known as Proof-of-Work, which is similar to Adam Back’s Hashcash. Proof-of-Work involves scanning of values using a hash function, a hash function is a mathematical function that takes an input and gives a fixed-size string of bytes.

Now, how does a miner use these hash functions? Well, they continuously try different nonce(not used values) which when hashed with the data of the block returns some hash value which starts with some number of zero bits, this number of zeros influence the amount of time required to get the exact nonce, meaning that as the number of zeros increases, the amount of time required to find the valid nonce also increases.

To implement the Timestamp Server into the network, we increase the value of nonce by some values until a value is found that gives the block’s hash the required zero bits. Once the miner finds the nonce that satisfies the proof-of-work requirements and creates a valid block, changing the data in the blockchain will require the miner to redo all the work. When more blocks are added to the network, the work to change any aspect of the block will require the effort to redo all the blocks after it.

Another major problem that Proof-of-Work solves is the determining representation in decision-making. If the concept of one-IP-address-one-vote is applied, then it can be misused by anyone who can allocate many IPs. Blockchain uses the concept of one-CPU-one-vote. If the majority of CPUs are controlled by honest nodes, then they can grow faster and outpace any competing chains. For an attacker to attack a block, they will need to redo all the work for every block and surpass all the kinda impossible work of honest nods.

As technology improves, computers get faster, allowing people to mine cryptocurrency more quickly. Also, the number of people interested in participating in the network can change over. To keep things fair and stable, the difficulty of mining new blocks is adjusted regularly. This adjustment is based on how quickly blocks are being produced compared to a target rate, which is usually an average number of blocks per hour. If blocks are being produced too quickly, it means that miners are working too efficiently, so the difficulty of mining is increased. This makes it harder to mine new blocks and helps maintain a steady rate of block creation.

Image description

The networking in the blockchain world

what do the nodes do when any transaction is made?

  1. A new transaction is broadcast throughout the network.
  2. These nodes add the data of the transaction to a block.
  3. The nodes try to find the best proof-of-work for the block.
  4. When a node finds the required proof-of-work, it broadcasts it to all the nodes.
  5. The other nodes accept the block only when the transactions are valid and not already spent.
  6. After accepting the new block, the nodes work on adding new blocks using the hash of the previous hash.

Now, what if two nodes broadcast two different versions of the next block? Well, the system accepts one block by default and works on it and keeps the other one IF its chain gets longer (because the nodes consider the longest chains). If by chance the node they didn’t choose becomes longer, then they switch to the longer one.

Now it is not certain that all the transactions reach every node, sometimes the block gets added so fast that all the nodes don’t even receive the transaction data. Now when the next block has to be added, the nodes who didn’t receive the data will realise that they have missed one.

Crypto Rewards: Fueling the Blockchain Boom

The first transaction in a block is always special because it starts a new coin owned by the creator of the block. Now to support the system some incentive(reward) is given to the nodes. Unlike traditional systems of transaction networks, there is no middleman or central authority which can control it, instead, cryptocurrencies are usually mined. Whenever a miner successfully adds a new block, they are given a “block reward” in the form of newly created coins. In the case of cryptocurrency mining the resources expended are CPU time and electricity, i.e. the computational power time required to solve the cryptographic puzzles and the electrical energy required while mining.

The other ways of incentives include Transaction Fees. To understand this let’s take an example

Let Ponyo(Japan) want to send 20 cryptos to Howl (America), when these cryptos reach Howl, the 20 cryptos can be reduced to let’s say 18 cryptos, and the 2 cryptos are the transaction fee that acts as the reward for the miners. Once the predefined number of coins is introduced no new coins can then be included, now this reward can completely transform into the transaction fee which is completely inflation-free.

Now, what if an attacker thinks of assembling more CPU power than all the honest nodes? Well, then they will have to make a tough choice between stealing money back from people or using it to generate new coins.

Before we go onto the next topic, I would like to say, GOOD JOB MATE (read this with an Australian accent). You have completed half of this hell. So far it has been very confusing yet interesting. Let’s see what the other half is about.

Trimming the Fat: Reclaim Desk Space

Reclaiming Desk Space is one of the ways to save memory, once the latest transaction block is buried under enough blocks, the spent transactions can be discarded to save the disc space. Now to do this Merkel’s tree concept is used, in this the transactions are hashed which further facilitates saving memory space without breaking the block’s hash. The branches of old Merkel’s trees with data can be stubbed or removed as they are not needed any longer time.

Image description

In the above picture, we can analyse Merkel’s tree, which is used to store data about a transaction. Merkel tree is like an inverted family tree. The main node has a Block Header which has the Block Hash, data about the previous hash, Nonce(Number used Once) which is a random or semi-random number that is used only once in a cryptographic communication, and lastly the data about the root hash. This main node is then connected to multiple other nodes which also have some data about hash functions.

Now one may think that saving all this memory of block hash, block header, prev hash etc etc can take up a lot of memory, but it is not the case because let’s say blocks are made every 10 minutes and each block header without transaction would be about 80 bytes. The yearly storage required for this block would be about 4.2 MG, considering the computers, back in 2008, nowadays, have storage of 2GB and according to Moore’s law this value increases by 1.2GB every year. Thus storing block headers in memory shouldn’t be an issue, even as blockchain networks grow.

Easy-Peasy Blockchain Payment Checks

Payment verifications can be easier in blockchain. In order to understand this let’s take an example of you attending a birthday party and you want some information without asking directly. Just like how you didn’t need to talk to everyone in the party to know about something specific, you can just talk to some key people, these key people in the Blockchain network are network nodes. You can ask these network nodes about the block headers of the longest chain of transactions, we can assume these block headers as the main summary of all the transactions.

Now let’s say you wanna confirm who brought the best birthday cake at the party, and in order to verify that you don’t need to ask everyone present at the party, instead you just need to know where all the info about the cake is stored. Just like this, a user can check the transaction or verify the transactions in the blockchain network.

Even though the user is not checking or verifying the transactions by themselves, they can trust the result by linking the transaction to the main summary of all the transactions. And further, if the chain gets more updates, it’s like getting more confirmation that the transaction is legit.
Image description

So far everything is fine, the user are not verifying every transaction but trusting other honest nodes but what iffffff, what if there is an attacker node huh? The network nodes can easily verify the transactions without any problem but what if an attacker node fabricates the information and overpowers the network. The solution to this problem is very easy, the nodes can keep an eye on security alerts that can detect an invalid block and alert transactions to confirm the inconsistency.

Businesses that get frequent transactions can form their independent security and run their nods thus ensuring safety and consistency in the system.

Coin Fusion: Mixing and Matching in the Crypto World

While doing transactions, multiple inputs and outputs can be combined in a single transaction, this way the transactions can be done easily and efficiently for everyday use.

Now to understand this let’s take an example:

Let’s say Jay wants to buy a new mouse and it costs around 1000 rupees, Jay does not have a single 1000 rupee bill but he has multiple bills and coins adding up to 1200 rupees. Now transactions using multiple bills and coins will be a very tiring job and it will also take lots of time. One way to fix this issue is by making one single transaction instead of making multiple, in this way, Jay is using 1200 rupees worth of bills and coins as the input. Now we can have 2 outputs, one for the mouse ie 1000 rupees and one for giving back the change, which in this case is 200 rupees. In this way, blockchain combines and splits value for a smoother and easier user experience.

Image description

Fan-out is a transaction which relies on other transactions and those transactions, in turn, rely on many other transactions. In the traditional system of fan-out, it is very difficult to practice because one need to have the info of all the other transactions which makes it very resource-intensive. But in blockchain fan-out is not difficult because here, the user does not need to have the information about all other transactions. When a transaction occurs, nodes only need to verify the validity of the transaction. They don’t need to retrieve and store the entire history of each transaction involved in the fan-out scenario.

Hush Hush: Privacy in Blockchain

Privacy can be a major concern in blockchain networks, as we know that each transaction in the network is publically announced, but how can this be secure or how can the privacy of the sender and receiver be maintained?

Let’s take a scenario where there is a thrift marketplace where multiple stalls are put up, in a traditional transaction process, when a buyer makes a purchase, only the buyer, the sender and maybe a third party(bank) get information making sure that the transaction process is private.

But what if, after every transaction is YELLED OUT? This will eliminate the privacy aspects because now everyone in the market knows who is buying what from whom. But this can be done in a better way, instead of announcing all the information like “Hiya bought 1 dress from Sara” we can say “x bought a dress from y”, in this way the market will know about every transaction, while the privacy of the buyer and seller is maintained.

This is the same concept that is used while trading, where the time and size of the individual trade is made public but without telling who were the parties.

Image description

An additional privacy system can be the inclusion of a public key (like a lock)and a private key(like a key to the lock), to access and send funds.

Let’s say you want to buy some paintings, you use a unique key pair to make the transactions. The public key associated with this transaction is like the address of the seller’s digital wallet, while the private key is your secret key. Now let’s say you want to buy some music, instead of using the same key pair as before, you generate a new one for this transaction. This way, the public key associated with this transaction is different from the one used for the book purchase.

Now what if you are making multiple transactions, like for eg you are collecting funds from different funds to make a single payment? Even though you will be using different key pairs for making each transaction, as all the inputs contribute to the same transaction may reveal the fact that they belong to the same owner.

The risk in this is that, if someone gets hold of one of your key pairs, they can find the owner and thus it becomes harmful. The solution to this problem will be to generate a new key pair for every transaction, making it more difficult to link transactions to a common owner.

Wohooo only one more topic and you are all done!! I am so proud of you for reaching here!! You’re hardworking and passionate. 🙂

Calculations

Let’s consider a scenario where an attacker is trying to create a different chain faster than the honest one. Even if this attempt is successful, it does not expose the system to any random alterations, such as generating an unpredictable value or taking money that never belonged to the attacker. The nodes are never going to accept a transaction with invalid credentials and the honest nodes are never going to accept a block consisting of them. The only way an attacker can fool the system is by taking the money back that he recently spent in a transaction.

To understand the rat race between the honest nodes and the attacker node while a transaction is made, we need to characterize each of them based on Binomial Random Walk.

The gap between the number of chains of the honest nodes and the attacker node can be considered by understanding the success and failure events in the honest nodes and the attacker node respectively. The gap gets extended by one block in the honest nodes chain whenever there’s a success event, meanwhile, the chain of the attacker chain extends by 1 when there’s a failure event.

To understand this let’s discuss the Gamblers Ruin problem.

Imagine you are playing a game where you start with a certain amount of money, but you owe some money initially. You keep playing the money, and with every round, you either win or lose some money. Now your motive is to reach a point where you have enough money to pay back the initial deficit and break even.

Now, let’s relate this to the situation of an attacker trying to catch up with the honest chain in a blockchain system.

  1. The player with the initial deficit represents the attacker who is behind the honest nodes.
  2. Each round of the game represents the attempt of an attacker to generate a new block faster than the honest chain.
  3. Winning money represents the successful creation of a new block and reaching the same level as the honest nodes or surpassing them
  4. Losing money represents failing to create a new block or falling behind the honest nodes.

We can calculate the probability of the attacker ever reaching the breakeven,or the attacker ever catching up with the honest chains by using the formulas given below.

Image description

If we assume that p>q, the probability of the attacker catching up with the honest nodes gets extremely low. If the attacker doesn’t make a lucky step forward in the beginning, it becomes nearly impossible to succeed.

Now it might be possible that the sender in a transaction might be the attacker, who sends money to the receiver, the attacker wants to make the receiver believe that the money has been sent for a while, and then switch back to pay back the amount after some time has passed. Whenever this happens, the receiver gets an alert about the same and the attacker hopes that it will be too late.

Whenever a transaction has to happen, the receiver creates a new key pair and then gives the public key shortly before the transaction happens. This prevents the sender from creating a chain of blocks before the transaction happens and then works continuously until the attacker gets far ahead, and the executing the transaction. One the transaction the attacker works secretly parallel on a chain containing an alternate version of the transaction.

The receiver waits until the transaction has been added to a block and the number of blocks has been linked after it(let’s say z number of blocks). The receiver usually has no idea about the progress the attacker has made, but the receiver assumes the average time taken by the honest nodes per block, the attacker’s potential progress will follow a Poisson distribution with a mean of…

Image description

What if the attacker still catches up now? In this case, to find the probability, we calculate the poison density for each potential amount of progress the attacker could have made and then multiply it by the probability that they could catch up from that particular point.
Image description

On rearranging this formula we get

Image description
Sorryy if you didn’t get the Calculation part, coz I found it a little difficult 🙁

I hope I was able to explain you the Bitcoin Whitepaper in a better and easy way. Lemme know if I missed out on something or if you have any suggestions. All the images have been taken from the original whitepaper(https://bitcoin.org/bitcoin.pdf) which you can refer to understand the topics in depth.

The post Bitcoin Whitepaper but easier appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/04/27/bitcoin-whitepaper-but-easier/feed/ 0
Analyzing Bitcoin Transactions with Lightning Node Insights https://prodsens.live/2024/04/12/analyzing-bitcoin-transactions-with-lightning-node-insights/?utm_source=rss&utm_medium=rss&utm_campaign=analyzing-bitcoin-transactions-with-lightning-node-insights https://prodsens.live/2024/04/12/analyzing-bitcoin-transactions-with-lightning-node-insights/#respond Fri, 12 Apr 2024 17:20:24 +0000 https://prodsens.live/2024/04/12/analyzing-bitcoin-transactions-with-lightning-node-insights/ analyzing-bitcoin-transactions-with-lightning-node-insights

Introduction Bitcoin Transactions: A Bitcoin transaction is a transfer of funds from one user to another on the…

The post Analyzing Bitcoin Transactions with Lightning Node Insights appeared first on ProdSens.live.

]]>
analyzing-bitcoin-transactions-with-lightning-node-insights

Introduction

Bitcoin Transactions:

A Bitcoin transaction is a transfer of funds from one user to another on the Bitcoin network. These transactions are recorded on the blockchain, a public ledger that contains all the transactions ever made on the network.

When a user wants to send Bitcoin to another user, they create a transaction by specifying the amount they want to send and the recipient’s address. The transaction is then broadcasted to the Bitcoin network, where it is verified and added to the blockchain by miners.

Each transaction has an input and an output. The input is the source of the funds and the output is the destination of the funds. The input includes the digital signature of the sender, proving that they are the owner of the funds, and the output includes the recipient’s address.

Bitcoin transactions are irreversible, meaning once a transaction is confirmed and added to the blockchain, it cannot be changed or canceled.

Lightning Network:

The Lightning Network is a layer 2 payment protocol built on top of the Bitcoin blockchain. It aims to solve one of the biggest challenges of Bitcoin — scalability.

The Lightning Network allows users to create a network of payment channels between themselves, enabling them to transact instantly and almost feelessly. These channels are created using smart contracts, and the balances are updated on the blockchain when the channel is opened, closed, or when making payments.

One of the main benefits of the Lightning Network is its ability to facilitate microtransactions, making it ideal for everyday transactions such as buying a cup of coffee or paying for a service.

Lightning Nodes:

A Lightning node is a computer or device that runs the Lightning Network software and connects to other nodes on the network. These nodes are responsible for routing payments between different channels and ensuring the integrity of the network.

To use the Lightning Network, one needs to either run a node themselves or connect to a node service provider. Nodes can earn small fees for routing transactions, which incentivizes users to run their own nodes and contribute to the network’s security and decentralization.

Setting up a full Lightning node

Setting up a full Lightning node is a crucial step towards strengthening the Lightning Network and contributing to the overall decentralization of Bitcoin. By running a full node, you become an integral part of the Lightning Network, helping to route payments and improve network efficiency.

Software and hardware requirements:

  • A dedicated computer or server with at least 8GB of RAM and 200GB of hard disk space

  • A Linux-based operating system (such as Ubuntu or Debian)

  • A high-speed internet connection

  • A stable power source

  • Access to your router settings to configure port forwarding

Step 1: Install dependencies

Before installing the Lightning Network software, you need to install certain dependencies on your computer. These are packages and libraries that are required for the software to run. You can follow the instructions for your specific operating system to install the dependencies:

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install git make golang-go gcc autoconf automake

CentOS/RHEL:

sudo yum update
sudo yum install git make golang gcc autoconf automake

Step 2: Install Lightning Network software

To set up a full Lightning node, you will need to install two pieces of software: LND and Bitcoin Core. LND is the software that runs the Lightning Network, while Bitcoin Core is the software that runs the Bitcoin blockchain. You can follow the instructions for your specific operating system to install the software:

Ubuntu/Debian:
Install LND: https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md#install-lnd
Install Bitcoin Core: https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#linux-instructions

CentOS/RHEL:

Install LND: https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md#install-lnd
Install Bitcoin Core: https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#building-with-mingw-w64-cross-tools

Step 3: Configure your router

To connect your node to the Lightning Network, you will need to open up certain ports on your router to allow incoming connections. These ports are 9735 for LND and 8333 for Bitcoin Core. You can follow the instructions for your specific router to configure port forwarding.

Step 4: Secure your node

Once your node is up and running, it is important to secure it to protect it from potential attacks. You can do this by setting up a firewall and configuring it to only allow certain types of traffic. You can also enable secure remote access through SSH and change the default login credentials.

Catch Quick Profits: Simple Scalping Strategies for Trading Newbies

Step 5: Connect to the Lightning Network

Now that your node is set up and secured, you can connect to the Lightning Network. You can do this by generating a payment address on LND and sending some Bitcoin to your node. You will then be able to send and receive Lightning payments through your node.

If you encounter any issues during the setup process, here are some common troubleshooting steps you can take:

  • Make sure your internet connection is stable and fast enough.

  • Check that you have enough hard disk space and RAM available.

  • Check your router settings and make sure the ports are correctly configured.

  • Make sure your firewall is not blocking any necessary traffic.

  • Check the logs for any error messages and try to resolve them. You can find the logs under the /var/log directory.

  • If all else fails, you can ask for help on online forums and communities dedicated to Lightning Network and Bitcoin.

Analyzing BTC transactions on a full Lightning node

  1. Blockchain Explorer

A blockchain explorer is a web-based tool that allows users to browse and view all the transactions and blocks on the Bitcoin blockchain. It provides transaction details such as sender and receiver addresses, transaction amounts, and fees. Popular blockchain explorers for Bitcoin include Blockchain.com, Blockstream.info, and Bitcoin.com.

  1. Bitcoin Core

Bitcoin Core is the official Bitcoin software client developed and maintained by the Bitcoin Core team. It allows users to run a full node, validate transactions and blocks, and create and manage Bitcoin wallets. It also provides a command-line interface that can be used for advanced transaction analysis.

  1. Lightning Network Explorers

Similar to blockchain explorers, Lightning Network explorers provide information about transactions and channels on the Lightning Network. Some popular Lightning Network explorers include 1ML, Joule, and RTL.

  1. Transaction Visualizers

Transaction visualizers are tools that use graphical representations to visualize the flow of transactions on the Bitcoin blockchain or Lightning Network. They can be helpful in understanding the relationship between different transactions and their impact on the network. Some examples include OXT.me and Lightning Terminal.

  1. Wallet Software

Bitcoin wallet software, such as Electrum, allows users to create and manage Bitcoin wallets, view their transaction history, and analyze their transaction details. Some wallets also offer advanced features for tracking and reporting on transactions, such as customizable transaction labels and exportable transaction histories.

  1. Network Analysis Tools

Network analysis tools, such as Bitnodes, can be used to track the health and status of the Bitcoin network. These tools provide real-time data on the number of nodes, blocks, and transactions on the network, as well as useful statistics and charts for further analysis.

  1. Excel Spreadsheets

For more advanced users, Excel spreadsheets can be a useful tool for analyzing and tracking Bitcoin transactions. By inputting transaction details and keeping a record of them, users can create their own customized reports and charts for deeper analysis.

  1. Cryptocurrency Tax Software

For users who need to report their Bitcoin transactions for tax purposes, there are specialized cryptocurrency tax software available. These tools integrate with various exchanges and wallets to automatically import transaction data and generate reports for tax filing purposes.

  1. Online Communities and Forums

Joining online communities and forums dedicated to Bitcoin and Lightning Network can be a great way to learn from other users and share knowledge about transaction analysis. These forums can provide valuable insights and tips for understanding transaction data and tracking transaction history.

  1. Developer APIs

Users with programming skills can utilize developer APIs, such as Blockstream’s Esplora API, to retrieve data from the Bitcoin blockchain and perform their own analyses and visualizations. These APIs offer access to real-time data and can be integrated into custom software applications.

Advanced analysis techniques

One way to use Lightning node data to identify trends in transaction volume is to look at the overall number of transactions being conducted on the Lightning network over time. This can be done by tracking the total number of transactions per day or per week and identifying any significant increases or decreases.

Additionally, it is possible to analyze the types of transactions being conducted on the Lightning network. For example, one could look at the percentage of transactions that are between nodes in certain countries or regions, or the percentage of transactions that involve specific types of goods or services. This can provide insight into the types of activity taking place on the network and any shifts or changes in transaction patterns.

Another way to utilize Lightning node data is to track network connections and transaction routes. This can help to identify which nodes are the most active or well-connected, as well as which nodes are handling the most transactions. Identifying patterns in network connections and transaction routes can also help to pinpoint any areas of potential congestion or inefficiency in the network.

Tracking changes in transaction fees and confirmation times can also provide valuable information about the Lightning network. By monitoring the fees being charged for transactions and the time it takes for these transactions to be confirmed, one can identify any changes or trends over time. This can be useful in understanding the overall health and efficiency of the network and whether any adjustments need to be made to improve its performance.

Security considerations

  1. Use a strong and unique password for your node Make sure to use a strong and unique password for your Lightning node. This will help prevent unauthorized access to your node and protect your private keys. Avoid using easily-guessable passwords and consider using a password manager to generate and store complex passwords.

  2. Keep your node software and operating system up to date Regularly updating your node software and operating system can help prevent vulnerabilities and bugs that could compromise your node’s security. Make sure to stay informed about updates and apply them when they become available.

  3. Use a firewall to control network access Consider using a firewall to restrict network access to your node. This can prevent unauthorized users from gaining access to your node’s data or attempting to launch attacks.

  4. Enable secure remote access If you plan to access your node remotely, make sure to use secure methods such as SSH (Secure Shell). Avoid using insecure protocols like FTP or Telnet, which transmit data in plain text and are vulnerable to interception.

  5. Use a hardware wallet for your private keys Consider using a hardware wallet to store your private keys securely. This will keep your keys offline and protect them from potential hacks or cyber attacks.

  6. Encrypt your node’s data and backups Encrypting your node’s data and backups will provide an extra layer of security in case your node is compromised. Use strong encryption methods such as AES or RSA to protect your data.

  7. Regularly back up your node’s data Just like with any important data, it is crucial to regularly back up your node’s data. In the event of a hardware failure or other disaster, having a recent backup will allow you to quickly recover your node.

  8. Be cautious when using third-party services Be cautious when using third-party services that require access to your node’s data or private keys. Make sure to thoroughly research the service and only use trusted providers.

  9. Enable two-factor authentication (2FA) Consider using two-factor authentication (2FA) for any accounts or services related to your node. This will provide an extra layer of security and prevent unauthorized access to your node.

  10. Monitor your node for any suspicious activity Regularly monitoring your node for any suspicious activity can help you identify and address potential security threats. Keep an eye on your node’s logs and investigate any unusual activity.

  11. Consider using a dedicated device for your node Consider using a dedicated device for your node to reduce the risk of your node being compromised. This will also minimize the amount of sensitive data stored on the device, making it less attractive to potential attackers.

  12. Use multiple secure backups in different locations In addition to regularly backing up your node’s data, consider storing backups in multiple secure locations. This will help protect against physical damage or disasters that could compromise your node’s data.

  13. Use encrypted communication channels for outgoing transactions When making outgoing transactions, make sure to use encrypted communication channels such as HTTPS or TLS. This will help prevent your transaction data from being intercepted or tampered with.

  14. Only use trusted channels for incoming payments Be cautious when accepting incoming payments and only use trusted channels. Avoid opening channels with unknown or suspicious parties, as this could potentially compromise your node’s security.

  15. Regularly review your node’s security measures It is important to regularly review your node’s security measures and make necessary adjustments to ensure your node remains secure. Stay informed about any updates or changes in the cryptography and security community to stay ahead of potential threats.

Case studies and real-world examples

  1. Identifying patterns of adoption and usage: By analyzing BTC transactions through full Lightning nodes, one can gain insights into the patterns of adoption and usage of the Lightning Network. This can help in understanding the growth of the Lightning Network and identifying areas for improvement.

  2. Monitoring user behavior and preferences: By analyzing the transactions on the Lightning Network, one can gain insights into user behavior and preferences. This can be used by businesses to understand their target audience and tailor their products and services accordingly.

  3. Fraud detection and prevention: Lightning nodes can be used to analyze suspicious transactions and detect potential fraud. This can help in preventing financial losses and maintaining the security of the network.

  4. Improving network efficiency: Full Lightning nodes can be used to analyze transaction times, fees, and other metrics, to identify areas for improvement in the network. This can help in making the Lightning Network more efficient and user-friendly.

  5. Gaming and e-sports industry: The gaming industry can leverage Lightning nodes for transaction analysis to track the usage of digital assets in online games and e-sports tournaments. This can help in identifying popular games, player behavior, and monetization opportunities.

  6. E-commerce and retail businesses: Lightning nodes can be used to analyze customer transactions for e-commerce and retail businesses. This can help in understanding customer preferences, popular products, and optimizing inventory management.

  7. Success story — Bitrefill: Bitrefill, a mobile top-up provider, uses full Lightning nodes to analyze customer transactions and optimize their inventory management. This has helped them reduce costs and improve the efficiency of their top-up services.

  8. Success story — Lightning Labs: Lightning Labs, a Lightning Network development company, uses full Lightning nodes to analyze user behavior and preferences on the Lightning Network. This has helped them make informed decisions about product development and improve the user experience.

  9. Success story — Boltz Exchange: Boltz Exchange, a decentralized exchange built on the Lightning Network, uses full Lightning nodes to analyze transaction data and detect potential risks such as network congestion. This has helped them ensure fast and secure transactions for their users.

The post Analyzing Bitcoin Transactions with Lightning Node Insights appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/04/12/analyzing-bitcoin-transactions-with-lightning-node-insights/feed/ 0
Top Crypto Events to Take Place in April https://prodsens.live/2024/04/08/top-crypto-events-to-take-place-in-april/?utm_source=rss&utm_medium=rss&utm_campaign=top-crypto-events-to-take-place-in-april https://prodsens.live/2024/04/08/top-crypto-events-to-take-place-in-april/#respond Mon, 08 Apr 2024 17:20:13 +0000 https://prodsens.live/2024/04/08/top-crypto-events-to-take-place-in-april/ top-crypto-events-to-take-place-in-april

While halving is dominating the industry, April still has a few trump cards to play. Discovering the important…

The post Top Crypto Events to Take Place in April appeared first on ProdSens.live.

]]>
top-crypto-events-to-take-place-in-april

While halving is dominating the industry, April still has a few trump cards to play. Discovering the important changes set to occur this month.

April is poised to become a month for monumental changes in crypto. Here is what to expect apart from Bitcoin’s halving.

SEC vs Coinbase Development

One of the pivotal cases in the regulatory spotlight promises to seek its proceeding. SEC and Coinbase mitigation is heating up as two entities are to agree on case arrangement by April 19.

Source: The Wall Street Journal | shannon stapleton/Reuters

This development is followed by court’s ruling against Coinbase’s motion to dismiss a SEC lawsuit, allowing the Commission to move forward with suing the crypto exchange for operating as an unregistered intermediary of securities.

Notably, U.S. District Judge Katherine Polk Failla agreed to dismiss SEC’s claim that Coinbase acted as an unregistered broker through its crypto wallet.

The silver lining amidst heating tensions marks the significance of the case, the developments of which may go beyond the United States and affect the whole industry.

The case stresses out the importance of coining a sound regulatory framework for cryptocurrency assets, which is being pursued by economic watchdogs across the globe.

As Volodymyr Nosov, the CEO at WhiteBIT exchange, believes, the lack of regulatory frameworks makes it challenging for crypto enthusiasts to operate with ease, marking its importance.

CZ’s Sentencing

On November 21, 2023, Chagpeng “CZ” Zhao pleaded guilty to a charge of failure to maintain an effective anti-money laundering program at Binance while leaving the chair of the exchange’s CEO and remaining free on a $175 million release bond in the U.S.

The story is not over for CZ as he is facing a maximum sentence of 18 months in prison, while prosecutors reportedly have considered asking for a harsher sentence.

The sentencing, initially set for March 30, has been postponed to April 30, and is set to solve the dispute about CZ’s involvement in Binance’s AML drawbacks.

Zhao’s case has sent ripples through the crypto market, highlighting the legal challenges facing industry leaders. The outcome of the litigation is eagerly expected due to the recent sentence of Sam Bankman-Fried, a founder and CEO of the notorious FTX crypto exchange.

March CPI Rate

The US Consumer Price Index (CPI) for March is set to be released on April 10. But why is it crucial?

CPI remains a critical economic indicator that could sway market sentiment, as it is one of the most commonly used tools for inflation and deflation measurement. But pivotally, CPI rate defies the urgency to cut or to increase interest rates.

The anticipation of March CPI is catalyzed amidst the recent updates on the US interest rates. In the latest Federal Reserve meeting, Chair Jerome Powell stressed out that the body is “not far” from cutting interest rates.

“We’re waiting to become more confident that inflation is moving sustainably at 2%. When we do get that confidence, and we’re not far from it, it’ll be appropriate to begin to dial back the level of restriction,” he stated.

Crucially, February’s CPI increase has kept investors on their toes, marking economic trends to be indirectly impacting the crypto market.

Paris Blockchain Week

One of the main blockchain events – Paris Blockchain Week – is set to take place from April 9 to 11, gathering the key personalities from crypto, institutional investment, and government under one roof.

The significance of the event is marked with bringing together the brightest minds and the top companies – all for pushing forward progress and stressing out the cruciality of Web3 mass adoption.

Among the top participants of the event are investors and developers at VanEck, Mastercard, Goldman Sachs, and other leaders of the DeFi sector. Not mentioning the members of the UK Parliament, Dutch Ministry of Finance, and journalists at the leading crypto media.

Such initiatives tend to spur the attention towards the Web3 sector, thus it is sponsored by the dominant entities in the industry, i.e. Stellar, XRP Ledger, Amazon Web Services (AWS), and WhiteBIT. The CEO of WhiteBIT, Volodymyr Nosov, commented on the event:

“WhiteBIT’s presence at the Paris Blockchain Week Summit and Token2049 Dubai underlines our commitment to innovation and development in the field of blockchain. We believe that real progress is achieved through joint efforts and sharing experiences, and this is one of our ways to contribute to the future of blockchain and cryptocurrencies.”

Block Reward Halvings

Ultimately, block reward halving for two major cryptocurrencies – Bitcoin (BTC) and Bitcoin Cash (BCH) – remains the top April occurrence for the industry.

BCH halving is expected to take place this week, cutting the mining rewards from 6.25 to 3.125 BCH. Such an event is crucial for controlling the coin’s inflation and supply dynamics, and spurs speculative interest due to the reduced rate of new coins entering circulation.

By the end of the month, Bitcoin halving is taking place. It will cut the reward for mining a block from 6.25 BTC to 3.12 BTC, causing extra scarcity of the currency. Historically, Bitcoin halvings have always been considered significant events, as they underwent alongside bullish market trends and the increase of BTC price specifically. While their factual effect is questioned, halvings have always fueled interest in crypto, providing for its greater adoption.

Bitcoin’s halvings’ history. Source: Techopedia

April may not bring the change in the game, but the month’s events are set to create a monumental impact to all vectors of the crypto industry development, marking its potential adoption at the full-fledged level.

The post Top Crypto Events to Take Place in April appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/04/08/top-crypto-events-to-take-place-in-april/feed/ 0
Blockchain explained easy https://prodsens.live/2024/04/06/blockchain-explained-easy/?utm_source=rss&utm_medium=rss&utm_campaign=blockchain-explained-easy https://prodsens.live/2024/04/06/blockchain-explained-easy/#respond Sat, 06 Apr 2024 17:20:50 +0000 https://prodsens.live/2024/04/06/blockchain-explained-easy/ blockchain-explained-easy

You’ve probably heard about blockchain, right? It can seem pretty confusing though.. Don’t worry anymore! In this article,…

The post Blockchain explained easy appeared first on ProdSens.live.

]]>
blockchain-explained-easy

You’ve probably heard about blockchain, right? It can seem pretty confusing though.. Don’t worry anymore! In this article, we’ll break down the important stuff about blockchain for beginners!

Key concepts

You have to remember that blockchain is: distributed, immutable, transparent and reliable. Let’s explain a bit more about each of these concepts:

Distributive Nature

This means it is duplicated thousands of times across different computers worldwide. Each copy in blockchain is called a node, and they all work together to maintain the information consistency. So – the data is spread out, making it harder to manipulate it or lose it.

Immutability

Once something is written into the blockchain, it can’t be changed or erased. This is immutability. Each piece of data is linked to the previous one in a chain, and any attempt to alter one block would break the chain, alerting everyone in the network!

Transparency

Every transaction that occurs on the blockchain is visible to anyone. This builds trust among users, as they can verify the accuracy of transactions without relying on a central authority.

Reliability: Consensus Mechanism

Decisions need to be made collectively by all the nodes. This is where the consensus mechanism comes into play. Different blockchain networks use various methods, such as Proof of Work (PoW) or Proof of Stake (PoS), to ensure everyone agrees on the state of the blockchain

The Block

This is the fundamental unit of a blockchain. Essentially blockchain is a sequence of linked blocks each holding a piece of information

The key components of a block in a blockchain are the block header and the block body
The block header is the portion of a block that contains information about the block itself (block metadata), typically including a timestamp, a hash representation of the block data, the hash of the previous block’s header, and a cryptographic nonce.
The body of a block contains transaction records including transaction counter and the block size.

How blocks are chained together

Blocks are records linked together by cryptography in a blockchain. This connection is achieved with hash functions. This means that the same input gets always the same output but the minor change in the input leads to change completely the output. This is called avalanche effect.

Each block has a block hash. The hash of the previous block is used to produce the hash value of the next block. The next block is “chained” with its prior block, reinforcing the integrity of all the previous blocks that came before.

Why block size is important

The block size determines the amount of data that can be included in a single block which ultimately affects the speed and efficiency of the blockchain network.
While some argue that larger block sizes are necessary to accommodate a growing number of transactions, others believe that smaller blocks are better suited for maintaining the decentralization and security of the network.
Let’s see some of the main differences in blocks:

Smaller block size Larger block size
each block contains fewer transactions more transactions can be processed in a single block
are more secure and decentralized because they require less storage space and computational power, making it easier for smaller miners to participate in the network. require more storage space and computational power, which can make it difficult for smaller miners to participate in the network
longer transaction times and higher fees reduced transaction fees and speeded up transaction times

To sum up the blockchain is distributed, immutable, transparent, and reliable. The fundamental unit is the Block and these blocks are linked using cryptographic hash functions, ensuring data integrity through a chain of blocks.

Sources:
https://academy.binance.com/en/articles/what-is-blockchain-and-how-does-it-work
https://www.theblock.co/learn/245697/what-are-blocks-in-a-blockchain https://bitcoin.org/bitcoin.pdf
https://www.theblock.co/learn/245697/what-are-blocks-in-a-blockchain
https://info.etherscan.com/exploring-block-details-page/ https://csrc.nist.gov/glossary/term/block_header.
https://www.geeksforgeeks.org/blockchain-chaining-blocks/
https://www.researchgate.net/publication/309983377_Electronic_Voting_Service_Using_Block-Chain#pf3
https://fastercapital.com/content/Block-size–The-Impact-of-Block-Size-on-Cryptocurrency-Block-Headers.html

The post Blockchain explained easy appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/04/06/blockchain-explained-easy/feed/ 0
Wagmi Essentials https://prodsens.live/2024/02/24/wagmi-essentials/?utm_source=rss&utm_medium=rss&utm_campaign=wagmi-essentials https://prodsens.live/2024/02/24/wagmi-essentials/#respond Sat, 24 Feb 2024 06:20:32 +0000 https://prodsens.live/2024/02/24/wagmi-essentials/ wagmi-essentials

Simulate contracts to get error messages before user tries it const { data, error, status } = useSimulateContract({…

The post Wagmi Essentials appeared first on ProdSens.live.

]]>
wagmi-essentials

Simulate contracts to get error messages before user tries it

const { data, error, status } = useSimulateContract({
    abi: BookingFactoryABI,
    address: process.env.NEXT_PUBLIC_BOOKING_FACTORY_ADDRESS as any,
    functionName: 'createBooking',
    args: [1n, 'simulate'],
  })

Estimate gas price for transaction to check if user has enough balance


  useEffect(() => {
    const a = async () => {
      if (publicClient) {
        const a = await estimateContractGas(publicClient, {
          abi: BookingFactoryABI,
          address: process.env.NEXT_PUBLIC_BOOKING_FACTORY_ADDRESS as any,
          functionName: 'createBooking',
          args: [1n, 'simulate'],
        })
        console.log(a, 'gasss')
      }
    }
    a()
  }, [publicClient])

Watch contract events to to retrieve write transaction reults

  useEffect(() => {
    if (publicClient) {
      publicClient.watchContractEvent({
        abi: BookingFactoryABI,
        eventName: 'BookingCreated',
        onLogs: (logs) => {
          console.log(logs)
        },
      })
    }
  }, [publicClient])

Wait for transaction receipt after on success in writecontractasync to get events for that transaction

await writeContractAsync(
      {
        abi: BookingFactoryABI,
        address: process.env.NEXT_PUBLIC_BOOKING_FACTORY_ADDRESS as any,
        functionName: 'createBooking',
        args: [influencersRequired, bookingId],
      },
      {
        onError: (error) => {
          setIsLoading(false)
        },
        onSuccess: async (hash) => {
          if (publicClient) {
            const receipt = await waitForTransactionReceipt(publicClient, {
              hash,
            })

            const bookingIdInBytes = keccak256(toBytes(bookingId))
            const log = receipt.logs.find((log) => log.topics[1] === bookingIdInBytes)

            if (log) {
              await axios.post('/api/booking/set-blockchain-address', {
                booking_id: bookingId,
                blockchain_address: log.topics[0],
              })

              // window.open('/dashboard/my-bookings', '_self')
            }
          }

          setIsLoading(false)
        },
      },
    )

The post Wagmi Essentials appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/02/24/wagmi-essentials/feed/ 0
Tracking Crypto Prices on Autopilot: GitHub Codespaces & Actions Guide https://prodsens.live/2024/02/19/tracking-crypto-prices-on-autopilot-github-codespaces-actions-guide/?utm_source=rss&utm_medium=rss&utm_campaign=tracking-crypto-prices-on-autopilot-github-codespaces-actions-guide https://prodsens.live/2024/02/19/tracking-crypto-prices-on-autopilot-github-codespaces-actions-guide/#respond Mon, 19 Feb 2024 09:20:37 +0000 https://prodsens.live/2024/02/19/tracking-crypto-prices-on-autopilot-github-codespaces-actions-guide/ tracking-crypto-prices-on-autopilot:-github-codespaces-&-actions-guide

Want to stay on top of your favorite crypto’s price, but tired of manual checks? This guide empowers…

The post Tracking Crypto Prices on Autopilot: GitHub Codespaces & Actions Guide appeared first on ProdSens.live.

]]>
tracking-crypto-prices-on-autopilot:-github-codespaces-&-actions-guide

Want to stay on top of your favorite crypto’s price, but tired of manual checks? This guide empowers you to build an automated Cryptocurrency Price Tracker with GitHub Codespaces, a cloud-based development environment, and GitHub Actions, for commit automation. Let’s dive in!

** Step 1: Secure Your Crypto Vault (Repository)**

  1. Head to GitHub and create a new private repository (e.g., “Cryptocurrency-Price-Tracker”).
  2. Name it wisely, reflecting your crypto passion!

** Step 2: Enter the Codespace Arena**

  1. Open your new repository and click “Code” -> “Codespaces” -> “Create codespace on main”.
  2. This unlocks your cloud-based development playground. Time to code!

** Step 3: Craft Your Price-Fetching Spell (Script)**

  1. In your codespace, conjure a tracker.py file.
  2. Let’s use Python and CoinGecko API to extract the desired crypto’s price:
import requests

def get_crypto_price(symbol):
    url = f"https://api.coingecko.com/api/v3/simple/price?ids={symbol}&vs_currencies=usd"
    response = requests.get(url)
    data = response.json()
    return data[symbol]['usd']

print(get_crypto_price('bitcoin'))

** Step 4: Automate the Price Updates (GitHub Actions)**

  1. Click the “Actions” tab and select “New workflow”.
  2. Choose the “Python application” template for streamlined setup.
  3. Replace the main.yml file with this magic formula:
name: Daily Crypto Price Update

on:
  schedule:
    - cron: '0 0 * * *' # Runs daily at midnight (UTC)

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python 3.8
        uses: actions/setup-python@v2
        with:
          python-version: 3.8

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install requests

      - name: Run the script
        run: python tracker.py

      - name: Commit and push changes
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "GitHub Action"
          git add -A
          git diff-index --quiet HEAD || git commit -m "Update crypto price"
          git push

** Step 5: Unleash the Automation!**

  1. Commit and push your code to the main branch.
  2. Visit the “Actions” tab and witness your workflow springing to life, updating prices daily!

Remember:

  • Adjust the script for your desired cryptocurrency.
  • Replace 'bitcoin' with its symbol.

Now you have a self-updating Cryptocurrency Price Tracker, powered by the magic of GitHub! Feel free to customize and explore further!

P.S.: A simple project to wish all of you: Happy coding!

The post Tracking Crypto Prices on Autopilot: GitHub Codespaces & Actions Guide appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/02/19/tracking-crypto-prices-on-autopilot-github-codespaces-actions-guide/feed/ 0
Web3 Vs Web2: The Untold Lies of Blockchain Technology https://prodsens.live/2024/02/08/web3-vs-web2-the-untold-lies-of-blockchain-technology/?utm_source=rss&utm_medium=rss&utm_campaign=web3-vs-web2-the-untold-lies-of-blockchain-technology https://prodsens.live/2024/02/08/web3-vs-web2-the-untold-lies-of-blockchain-technology/#respond Thu, 08 Feb 2024 17:20:25 +0000 https://prodsens.live/2024/02/08/web3-vs-web2-the-untold-lies-of-blockchain-technology/ web3-vs-web2:-the-untold-lies-of-blockchain-technology

I lost some ETH two weeks ago because I sent it to another. network and that was all,…

The post Web3 Vs Web2: The Untold Lies of Blockchain Technology appeared first on ProdSens.live.

]]>
web3-vs-web2:-the-untold-lies-of-blockchain-technology

I lost some ETH two weeks ago because I sent it to another. network and that was all, no way to get it back. It was just gone.

I sat down, reflecting on how fickle and easy it is to lose tokens because of the acclaimed security infrastructure, but it does not give room for learners to thrive as any little error; all your hard work is gone.

When the news about ETFs came out, I was shocked to see crypto enthusiasts excited. I was a bit taken aback. Is ETF not centralized, so why is it a call for jubilation? and it hits me.

This looks like a giant money-making business and nothing more.

Before I dive deeper, let us look at Web2 and Web3 and see if we can spot the core difference between them.

Web3 and blockchain technology hype has reached a fever pitch in recent years. Proponents claim it will revolutionize the internet, handing power back to users through decentralization while providing greater transparency, security, and privacy.

However, peel back the marketing gloss, and many of the claims about Web3 fail to hold up to scrutiny.

In reality, Web3 suffers from significant technical limitations, lacks killer consumer use cases, and is unlikely to fully replace the Web2 model that has driven the internet’s growth for the past 20 years.

This is why.

Centralized Giants Still Reign

A core premise of Web3 is decentralization through blockchain technology. Yet many popular Web3 applications still rely on large, centralized intermediaries.

  • Cryptocurrency exchanges like Coinbase and Binance function much like traditional banks, custodians of user assets, and they can shut down, block, or control how you use your tokens.

  • NFT marketplaces like OpenSea use blockchain technology, but transactions flow through centralized servers.

  • Many crypto and Web3 companies still store user data and process transactions using centralized cloud service providers like AWS.

This introduces security risks, points of failure, and the same intermediary rents Web3 was supposed to eliminate.

The Web2 giants also aren’t going anywhere. Rather than ushering in a new decentralized age, Web3 could further entrench existing Big Tech power structures.

Blackrock recently got approval to float ETF, proving we are getting more of a circle than a straight line.

Overpromising on Security

Another key promise of Web3 is enhanced security and privacy through encryption and decentralization. However, the track record reveals a technology still vulnerable to hacking and exploitation.

Since 2019, over $3 billion has been lost in DeFi hacks and scams. Botched smart contract code, flash loan attacks, phishing schemes and more have drained funds from Web3 protocols that claimed bulletproof security.

Every other day on Twitter, companies like CodeHawks, Cyfrinaudits, and many other platforms spring up daily. finding vulnerabilities in alleged secure smart contracts where millions are wiped daily, and there is no method to get them back.

Even decentralized networks like Bitcoin and Ethereum have experienced several 51% attacks or threats where a single miner gained majority control.

Cryptocurrency exchanges are hacked, so often, sites are dedicated to tracking exchange theft.

For the average consumer, Web2 services like banks and credit cards provide simpler and stronger security guarantees than the Wild West landscape of Web3 today.

According to Infosecurity, in 2022 and 2023 alone, the total number of hacks amounted to 5.3 billion.

Limited Use Cases, Confusing UX

Web3 lacks compelling uses for regular internet users outside of speculation. Buying NFTs of monkey cartoons, trying to make money via yield farming, or purchasing virtual real estate in Decentraland haven’t attracted mainstream uptake.

At the same time, Web3 introduces unfamiliar concepts like gas fees, seed phrases, crypto wallets, and DAO governance that make it painful for casual users to navigate.

Apart from being an avenue to trade, there is no other direct usage of crypto, and that is a fact; everything else is just hype and tears.

Key management also places full responsibility on individuals to secure funds without any of the consumer protections around fraud or theft in traditional finance.

Until Web3 can move beyond this confusing user experience and showcase why its applications are superior for non-technical users compared to Web2, its promise will remain largely unfulfilled for the masses.

Questionable Environmental Impact

One of the biggest criticisms against blockchain technology is its massive energy consumption and carbon footprint due to the computations required for mining.

Although networks like Ethereum have transitioned to less intensive consensus models, this environmental impact casts doubt on the claim that Web3 represents evolutionary progress.

Bitcoin still uses proof of work, which is energy-intensive, and while many still doubt the objectivity of such work only for one winner, time will tell when the final coin is mined.

Between questions about financial inclusion, regulatory uncertainty, rampant scams, and more, there are still many open-ended issues around whether Web3 can deliver on its lofty vision to overhaul the digital economy and internet architecture as we know it.

The Next Internet Revolution?

None of this suggests decentralized technology lacks merits or isn’t worth pursuing. However, based on results, Web3 seems unlikely to supplant Web2 as the predominant internet model soon.

The internet took decades to develop into what it is today, with early dot-com crash implosions and painful lessons. Web3 will follow a similar arduous path of evolution versus sudden revolution.

For Web3 to fulfill its destiny as the next paradigm powering how we interact online, it needs to move beyond the land grab speculation and mania into real consumer problem-solving.

Only then can it showcase why decentralization provides fundamentally better solutions and user experiences than today’s Web2 giants.

Until Web3 projects address fundamental usability, security, and sustainability challenges, prove adoption beyond crypto insiders, and give people reasons to switch in daily life, the Web2 model looks poised to dominate for years to come.

Behind the lofty ambitions, hype cycles, and proclamations of revolution, the Web3 ecosystem has substantial progress left to make good on its promises.

Finally, Web3 will thrive, and I believe it is on to something, but I do not feel it is there yet or the hype is anywhere near what it should be.

While I still mourn the loss of my tokens, I do feel If you find this post exciting, find more exciting posts on Learnhub Blog; we write everything tech from Cloud computing to Frontend Dev, Cybersecurity, AI, and Blockchain.

The post Web3 Vs Web2: The Untold Lies of Blockchain Technology appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/02/08/web3-vs-web2-the-untold-lies-of-blockchain-technology/feed/ 0
Best Crypto To Invest in 2024 [Expert Guide] https://prodsens.live/2024/01/30/best-crypto-to-invest-in-2024-expert-guide/?utm_source=rss&utm_medium=rss&utm_campaign=best-crypto-to-invest-in-2024-expert-guide https://prodsens.live/2024/01/30/best-crypto-to-invest-in-2024-expert-guide/#respond Tue, 30 Jan 2024 11:20:18 +0000 https://prodsens.live/2024/01/30/best-crypto-to-invest-in-2024-expert-guide/ best-crypto-to-invest-in-2024-[expert-guide]

Do you know that in 2024 there are certain crypto tokens are likely to rise, and if you…

The post Best Crypto To Invest in 2024 [Expert Guide] appeared first on ProdSens.live.

]]>
best-crypto-to-invest-in-2024-[expert-guide]

Do you know that in 2024 there are certain crypto tokens are likely to rise, and if you are not aware of them you will be losing big time?

2024 is the year of Crypto, as In 2022 alone, crypto adoption surged over 186%, with 221 million users worldwide.

According to Forbes, ETF broke the market recently as BlackRock, an asset management company spot ETF was the first to reach 1 billion.

I share the Best Crypto To Invest in 2024 [Expert Guide], where I postulated some of the best tokens to invest in 2024.

Read: https://blog.learnhub.africa/2023/12/30/best-crypto-to-invest-in-2024-expert-guide/

The post Best Crypto To Invest in 2024 [Expert Guide] appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/01/30/best-crypto-to-invest-in-2024-expert-guide/feed/ 0