Dave (@dave_soos) β’ Hey
Developer Advocate @Chainstack.lens, an amazing blockchain infrastructure provider. My focus is to help share great content that will help current and futu
Publications
- π I've recently launched a new series on LangChain! π If you're passionate about AI and technology, this series is tailored just for you! π
5 articles are live, walking you over the basics, loading and splitting data, and uploading vectors to vectors DBs!
Stay tuned!
https://soosweb3.hashnode.dev/series/langchain
- Just launched my new AI-powered personal page!
https://davideai.dev
A blend of tech, weekends & caffeine has resulted in a portfolio where you can ask anything about my profile.
Powered by LangChain, OpenAI, and Pinecone, this is just an example of how LLM-powered apps can be used.
Disclaimer: Still a bit rough around the edges; I'll open-source it once I clean it up a bit
- Let's talk about Subgraphs! This guide will help you get a better understanding of the power of subgraphs for easy access to on-chain data. So buckle up, and let's get started!
You can find the full guide and tutorial on the Chainstack dev portal:
https://docs.chainstack.com/docs/subgraphs-tutorial-indexing-erc-20-token-balance
A bit of history: #ERC20 is a widely-used standard for creating fungible tokens. It provides a consistent set of rules & standards for developers to follow, making it easier to create and interact with tokens. Now, let's dive into subgraphs!
We'll use subgraphs to index Ethereum accounts & their ERC20 token balances. Our main focus will be on capturing & processing the Transfer events emitted when tokens are transferred between accounts, which can provide token balances & addresses.
For this project, we'll define Token, Account, and TokenBalance entities in our `schema.graphql` file. Then, we'll modify our manifest file to use the updated entities and remove any unnecessary event handlers.
Follow the steps in the tutorial: https://docs.chainstack.com/docs/subgraphs-tutorial-indexing-erc-20-token-balance
Ready to deploy? Use Chainstack to build & deploy your subgraph. Remember that due to the scale of the data, synchronization can take multiple days. Be patient!
Finally, use the GraphQL UI URL to query & view the data! Fetch the list of accounts & their token balances with a simple query. This is a great example of how subgraphs can easily fetch, process, & organize scattered data like ERC-20 token balances.
In conclusion, Chainstack Subgraphs empower Web3 developers to index & query data from decentralized networks like Ethereum, making it easier to build efficient DApps. We hope this guide helped you understand the power of subgraphs! Keep exploring!
- Join the LW3 DAO workshop featuring @priyank.lens and @chainstack.lens going over subgraphs for beginners!
https://discord.gg/learnweb3dao-872804414107312158?event=1103080881532440576
- Public and private keys are fundamental concepts in #cryptography and play a significant role in #blockchain protocols.
Here's a quick rundown based on #Ethereum :
Bonus code example included!
Read this article by @Wuzhong_Zhu to go more in the weeds!
https://t.co/6x2L6QV73P
Firstly, let's understand the private key. Ethereum private keys are 32 bytes/256 bits, and only the owner knows it.
In cryptography, private and public keys are used for encryption and authentication. The public key is known to all, and the private key is known only to the owner.
In the case of encryption, a message can be encrypted with the recipient's public key, and only the recipient can decrypt it with their private key.
But for blockchain protocols, authenticity is crucial. When a transaction is sent, it needs to be verified that it's genuinely from the sender.
The sender's private key generates a signature that anyone can verify with the sender's public key. Without the private key, no one can forge a signature.
Takeaway 1: Public key is generated from the private key, and authenticity is the primary use case in the blockchain.
Takeaway 2: A private key is not a password. It's a secret that should be kept safe and never shared.
Let's see how it happens: Generating a private key Ethereum's private key is a 32-byte/256 bits data that can be represented as a 64 hexadecimal character string. Private keys can be generated from seed/mnemonic phrases using BIP-32, BIP-39, and BIP-44.
Using ECDSA to generate a public key Once a private key is obtained, Ethereum uses ECDSA (Elliptic Curve Digital Signature Algorithm) to produce a public key. The public key is of 128 hexadecimal characters/64 bytes/512 bits.
Ethereum uses Keccak-256 for hashing. A hashing function converts a data input in any size to a fixed-size output. The hashed data is 32 bytes/256 bits.
Obtain the on-chain address The first 12 bytes/96 bits from the hashed data are removed, and the remaining 40 hexadecimal characters/20 bytes/160 bits of data are used as addresses. The address is usually prefixed with "0x-".
In conclusion, the private key generates the public key, which is hashed to obtain an on-chain address. Get more details on the article:
https://t.co/6x2L6QV73P
**Let's get to practice now. Checkout my repo to find the full code and test it:**
https://t.co/PE0AwGdecj
For this, we use the ethereum-cryptography JavaScript library.
TL;DR this code defines some functions to perform the process of signing a message and retrieving the Ethereum address.
This will basically teach you how to extract the address from private keys and signed messages!
The hashThis function converts a string to a byte array and hashes it using SHA-256. It returns a hexadecimal string of the hash value. The hashMessage function hashes a message using Keccak-256 and returns a byte array of the hash value.
The encodeEvent function encodes an event signature as a hexadecimal string. It takes a string input, hashes it using Keccak-256, and returns a prefixed hexadecimal string.
The signMessage function signs a message using a private key and the secp256k1 method. It returns the signature and recovery bit.
The recoverKey function recovers the public key from the message and signature using the secp256k1 method. It returns the public key.
The getAddress function retrieves the Ethereum address from a public key. It hashes the public key using Keccak-256, takes the last 20 bytes, and returns a prefixed hexadecimal string of the address.
The main function takes a private key, hashes a message using SHA-256 and Keccak-256, signs the message, recovers the public key, and retrieves the Ethereum address from the public key!
So this allows you to prove that an address belongs to a private key!
- Why is the concept of #Web3 so powerful?\n\nWeb3 represents the future of the internet: a decentralized, open platform that puts power back in the hands of the people.\n\nWith Web3, we can create a truly democratic online space where everyone has a voice and the ability to shape the direction of the web.\n\nWeb3 technologies like blockchain and decentralized finance give us the power to build a more equitable and inclusive internet, where everyone has access to the same opportunities and resources.\n\nThe potential of Web3 is huge, and it's up to us to seize this opportunity and build a better, more decentralized web for everyone.\n\nLet's embrace the power of Web3 and work together to create a more open, transparent, and equitable online world. \n\n#Web3 #Decentralization #Blockchain
- Explore Debug and Trace on Erigon and Geth! This app allows you to test the debug_traceTransaction method comparing Erigon and Geth.
Find it on JSFiddle!
https://jsfiddle.net/soos3d/ty3mhpvk/
Full article link π
You can also read the full article about the two main Ethereum clients, Erigon and Geth!
https://chainstack.com/ethereum-clients-geth-and-erigon/
#web3
#ethereum
#debug
#trace
#chainstack
#evm
- Despite the #FTX dumpster fire, blockchain tech still grows. Events like this, unfortunately, slow things down, but we need to keep building!
And at now is an excellent time to learn about #Ethereum clients and how they workπ
Geth & Erigon article π
https://chainstack.com/ethereum-clients-geth-and-erigon/β¦
π£ Reading this article, you will:
π£ Review EVM basics.
π£ Learn what Go Ethereum is.
π£ Know what Erigon is.
π£ Basic commands.
π£ Differences.
π£ Basics about debugging and tracing modules.
Go Ethereum, often abbreviated to Geth, is a Command Line Interface (CLI) Ethereum client written in Go (An open-source programming language developed by Google) and is the official Go implementation, fully open source, and licensed under GNU LGPL v3.
π£ How does Geth synchronize?
Synchronization is the process that allows the node to get the latest and updated blockchain state from other nodes, and when you start the sync process, your client will look for other peers in the network to download data from.
Erigon is very much based on Go Ethereum, and we can see it as a fork of Geth. It is also written in Go, and the Erigon team re-engineered the Ethereum implementation to make it more efficient and reduce disk space usage.
π£ Erigon staged sync
Erigon improves sync speed by adopting a staged sync process. When Geth synchronizes a full node, it downloads the blocksβ data. Then, it replays the transactions while working on other operations, for instance, retrieving the senders of the transactions from the private signatures or verifying the block headers. As a result, the process is less efficient since many things are happening simultaneously.
#web3
- At least we get good memes out to cheer us up π
- This all FTX meltdown shows how we really need better fiat on/off ramps. At the end of the day we still rely on some centralized entity that requires KYC.
I don't have an answer atm, but this clearly is not the way.
- Today I minted an NFT on zkSync! ZK rollups will open more doors to onboard people, especially if they implement account abstraction. But I must say that it's still challenging to use for a non-web3 junkie or dev.
- Use an EOA wallet.
- Move funds from a CEX.
- Bridge funds from Ethereum to L2.
- Remember to distinguish L2 from L1.
- And so on...
But we are on the right path little by little π
- Today I minted an NFT on zkSync! ZK rollups will open more doors to onboard people, especially if they implement account abstraction. But I must say that it's still challenging to use for a non-web3 junkie or dev.
- Use an EOA wallet.
- Move funds from a CEX.
- Bridge funds from Ethereum to L2.
- Remember to distinguish L2 from L1.
- And so on...
But we are on the right path little by little π
- Am I the only one scared about centralized exchanges after the FTX saga and BlockFi announcing trouble? πΆ
- An excellent way to start #web3 development is to learn how to interact with smart contracts.
I made an article about this on Hashnode!
Learn how to interact with smart contracts using #Python!
Linkπ
https://soosweb3.hashnode.dev/call-smart-contract-functions-using-web3py
- Zero-knowledge rollups are a hot topic lately, but which projects are ahead in the game?
Some projects making good progress are:
π΅ StarkNet
π΅ zkSync |
π΅ Scroll |
π΅ Polygon zkEVM |
And if you want to learn more about developing on StarkNet, checkout this repo!
https://github.com/soos3d/Create-and-deploy-a-smart-contract-on-StarkNet
- This weeks twitter drama is pushing me to try this out more substantially
Hello Lens! ππ
- Many new chains are coming up lately, all focused around zero-knowledge
Zero-knowledge is a powerful concept where we can validate the state of something without having to process it or see sensitive information.
Some notable projects are:
Starknet
zkSync
Scroll
- What's your dream web3 company to work for?
Let us know and we'll get them on the job board π
- Solidity basics lesson 1 | Remix IDE & Solidity docs
What better place to share content to learn about Solidity and blockchain development!
This is the first video of this series, these videos are taken from my Solidity basics course on Skillshare.
This is what you need if you want to become a blockchain developer!
In this video I will explain what the Remix IDE is and how we can use it to learn about blockchain development. We`ll also talk about the Solidity documentation.
This course is designed for beginners with little to no coding experience and I explain all of the fundamentals in great details with plenty of practical examples!
Check the full course now live on Skillshare! get 30 days for free using this link!
https://skl.sh/3K3VJXg
From the Solidity documentation:
Solidity
Solidity is an object-oriented, high-level language for implementing smart contracts. Smart contracts are programs which govern the behavior of accounts within the Ethereum state.
Solidity is a curly-bracket language designed to target the Ethereum Virtual Machine (EVM). It is influenced by C++, Python and JavaScript. You can find more details about which languages Solidity has been inspired by in the language influences section.
Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features.
With Solidity you can create contracts for uses such as voting, crowdfunding, blind auctions, and multi-signature wallets.
- I played a bit around with the pre-alpha release of Scroll, a zkVM, to be so early in development it was a good experience, no errors and fast transactions.
I even deployed an ERC20 token and added some liquidity π
The contract creation transaction was confirmed almost immediately! Go buy some Web3Dave tokens on the L2 testnet π
https://l2scan.scroll.io/address/0x50583434136284D87D11c185Bb64B0203deC5177
- Do you want to learn how to deploy smart contracts on #zkSync? This is for you, then!
Just published a repo with a Hardhat project to deploy a simple smart contract to the zkSync testnet. Scroll will be next!
You will learn to use the zkSync plugins to compile and deploy a contract on the zkSync testnet.
Then you can interact with it using the #Ethers library!
Link to my GitHub repoπ§΅π
https://github.com/soos3d/Deploy-a-smart-contract-on-zkSync-using-Hardhat
- Time for some π§ Blockchain Glossaryπ§
The #blockchain environment is full of less known or even new terminology!
This post is a collection of definitions so that new people who want to get into #development have somewhere to start! I'll make one of those periodically with new terms.
#Decentralized:
Decentralization is the staple of blockchain technology, and it means distributing the control and decision power to multiple entities.
This is important because it means that no one individual or organization can control the network!
#web3:
Term used to refer to the "decentralized web" and is often used to refer the blockchain and the decentralized ecosystems as a whole.
Decentralized application (#DApp)
A DApp is an application running on a decentralized network (blockchain) instead of running on a private server as "regular" apps do.
A decentralized exchange (#dex ) such as Uniswap is an example of a DApp.
#Node:
A node is a computer connected to a blockchain network running an Ethereum client software. The purpose of a node is to validate transactions and keep track of the state changes. You need to communicate with a node to interact with a blockchain.
Blockchain client:
A client is a software that nodes run to access the network and process the transactions.
For example, Go Ethereum (#geth) for #Ethereum and AvalancheGo for #Avalanche.
Node Provider:
Providers (like Chainstack) offer infrastructure services by running nodes that you can use to power a wallet (#MetaMask) or a DApp. Deploying a node is time and resource intensive, and node providers are vital for the blockchain environment.
Smart contract:
It is a program stored on a blockchain that runs when certain conditions are met. They are fundamental for #web3, as once a contract is on the #blockchain, it is not possible to change it without having to deploy a new one.
Being immutable makes smart contracts more transparent and virtually impossible to hack. The contract is run by code, so it's always going to be processed in the same way.
- The Monopoly guy eating a burger created with DALL.E
#AI #AIart
- Drawing created by an AI, it was surprisingly close to my description! AI creating content for a decentralized social media LOL
- First post on Lenster, web3 social media it's cool!π€―