Ad

Monday, November 15, 2021

DOM Tree Basics - What's a DOM Tree

 

Here's the visualization on wikipedia of a DOM tree.

#webdevelopment basics #DOM #100DaysOfCode

Sunday, November 14, 2021

dotenv : Setting up environment variables for dev environment

 It's very important to protect API keys, private keys in blockchain and API development. In general the best practice is: do not have API keys, or any secrets, sitting unprotected in code bases, even if it is in the server side logic. Front end code is definitely a big no no. We use environment variables to manage private keys and secrets. Some cloud platforms such as Google Cloud offers encrypted, cloud managed keys, with extra features such as key rotations, that's pretty cool.  Here're are some tips from Chainlink smart contract hardhat starter kit. 

There are two options of setting environment variables: store credentials in a .env file AND set it in command line. Remember to add any env file to .gitignore else you risk losing your credentials and subject your app to attack and misuse. Bad parties can steal your API keys make unauthorized transactions /requests and incur cost / lost.


The bash one works directly in the command line. The .env one is to be used with the dotenv npm package.

dotenv (node, npm package, weekly download 15,514,927 as of Jan 2022). "Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env." https://www.npmjs.com/package/dotenv

# with npm

npm install dotenv


# or with Yarn

yarn add dotenv

To verify installation is successful, also check the package.json file. 

require('dotenv').config()


Create a .env file in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE. For example:

DB_HOST=localhost

DB_USER=root

DB_PASS=s1mpl3


process.env now has the keys and values you defined in your .env file.

const db = require('db')

db.connect({

  host: process.env.DB_HOST,

  username: process.env.DB_USER,

  password: process.env.DB_PASS

})


Once we define environment variables in the .env file the values are available with the process.env. prefix. That's pretty cool. Definitely exclude the .env file form git history and git push.

The environment variables sit near the operating system, or the virtual environment the code is running on. The code only pulls the value of the secrets. "Platforms can have its own unique mechanism for storing and retrieving environment variables. " https://youtu.be/17UVejOw3zA



Getting started with Chainlink for developers

Chainlink Developer Resources: Chainlink offers developer the ability to use Oracles for writing hybrid smart contracts. Oracles are like blockchain middleware. Chainlink provide decentralized oracle networks, aiming to provide better crypto, randomness and security for data and DeFi apps. Some words that chainlink likes to use to describe itself trustless, permissionless, math guarantees, agreements

Share and Link to this blog post:
Getting started with chainlink [public]
https://www.siliconvanity.com/2021/11/getting-started-with-chainlink-for.html

Top Features:

Chainlink offerings include : Data Feeds, Chainlink VRF, Chainlink Keepers, or Chainlink API.

Oracle: 

It's important for blockchain to have deterministic values, which is great for reaching consensus, but real world apps often need variables - values that are changing, such as when querying a weather API. This is where Oracle comes it. Oracles fulfill the need to help blockchains connect with the real world while still providing decentralized infrastructure.
 
this is a keyword you will hear a lot getting started with Chainlink. 
What are oracles:
"mechanisms of blockchains, smart contracts have no built-in capabilities for interacting with external resources like data providers and API services as a means of verifying the outcome of real-world events happening outside the blockchain. This creates what is known as the blockchain oracle problem and represents one of the greatest limitations to representing everyday contracts on the blockchain. To overcome this lack of connectivity, hybrid smart contracts use oracles as middleware to retrieve external data inputs, push data outputs to external systems, and perform scalable off-chain computations. Not only do oracles serve as a two-way bridge between smart contracts and the outside world, but they also provide a security framework for protecting against any single point of failure such as data manipulation and downtime." - official doc

The business model of chainlink is fascinating, being the middleware of blockchain, serving such a crucial role, chainlink always can charge fees, and chainlink always gets paid. 

"Chainlink Price Feeds provide a large collection of streaming market data. Developers can currently integrate easy-to-deploy code to retrieve Price Feeds for crypto assets, commodities, FOREX, and more market data, opening up a huge number of potential applications. "

"Not just an endpoint, API, has to be decentralized to secure
Separate service, middle ware that lives on top of the chain
Oracle is responsible for connecting to the api of the outside world. 
If it is one point of failure, each to hack, easy to compromise." - zak ayesh developer advocate chainlink

Chainlink can do some stuff that blockchain won’t want to do or cannot do : random number, time keeper. Chainlink does this by using decentralized oracles, running hybrid smart contracts. Chainlink network aims to be trust-less : no need to rely on brands, big corp promises. 

Can be used to agree, aggregate price data, price pairs. 

Chainlink Decentralized oracle network (DON) definition

Data feed: 

"Chainlink Data Feeds are the quickest way to connect your smart contracts to the real-world market prices of assets. For example, one use for data feeds is to enable smart contracts to retrieve the latest pricing data of an asset in a single call." 

data from different chains, and even real world data e.g. weather, e.g. retrieve the current ETH/USD price. Clients include top DeFi apps.

Chainlink Data Feeds : (source workshop slides)
Check out the data feed available data.chain.link . Data feeds bring off chain data on chain. Financial data and API
* Market coverage (DEX & CEX's)
* Mix of premium data providers/aggregators
* Use volume based average method of aggregating data
* Feeds live on multiple blockchains
* Most feeds now upgraded to use OCR

Data feed - contract addresses : 

Chainlink warns the data quality is important. Always check if you are using the best quality data feed.  https://docs.chain.link/docs/reference-contracts/

Random number generation : 

Random number generation is often useful in blockchain development.

Programming language:

You will get experience with (no prior experience required): Solidity, Javascript with web3.js, Python with Web3.py (if you prefer python > javascript)

Tutorials landing page: 

https://docs.chain.link/docs/tutorials/

Chainlink hackathon: 

There are many workshops and bootcamps to help you get started. View past winners https://docs.chain.link/docs/example-projects/

Massive alumni success. If won, can pitch to vc. resume builder. 

Chainlink use case


Read more ... 77+ Smart Contract Use Cases Enabled By Chainlink . Trivia knowledge: this post used to be called 44 ways, and now it is increased to 77 ways. More on chainlink use cases. 

Other roles/functions in the chainlink ecosystems: What brought you to Chainlink? A Integrate Price Feeds/Market Data/External APIs, B Integrate Verifiable Randomness (VRF), c Integrate Proof of Reserves, D Integrate Chainlink Keepers, E Build Cross-Chain Applications, F Become a Data Provider, G Become a Node Operator

Chainlink Starter Kit:
Chainlink Starter Kit has chainlink smart contract codes, and supports Hardhat, Brownie, Foundry etc. For more support: discord, documentation, stack overflow, Starter Kit. 

Check out the chainlink hardhat docs and repos.

Chainlink Career
chainlinklabs.com/careers

Chainlink advanced

Not the focus of this blog post. We cannot go deep into this area. But here are some of the potential topics to explore (interesting topics): 
  • Build your own DON : running a chainlink node
  • Gain loss estimate
  • Check out Chainlink's Github for more repos
  • Chainlink Off-Chain Reporting (OCR). Each node reports over p2p. Each nodes sign data. Single node submits. Full data all available on-chain Aggregation still done on-chain. Off-chain reporting : Chainlink nodes, smart contract, reduce gas costs up to 90%




Disclaimer:  
Always do your own research and consult professionals before making any decisions. The contents on our sites and channels are NOT financial advice. 

WARNING: when developing for blockchain, definitely use testing throwaway wallet, testnet and testnet tokens to develop your dapp and test extensively. Deploy to testnet first and get testnet coins.  Even if you are a good developer, you will want to use well-tested contract, smart contract templates like OpenZeppelin. And get professional audit help. 

A warning and a reminder : None of our content is for production use. None of our content is production ready. None of our contents or codes have to been tested in production environment. In other words, our contents are NOT suitable for production/live environments. Our contents are informational only. Our contents are NOT tested, or developed for live environment.

WARNING: mentioning a technology is not a form of endorsement. Quoted opinions are those of the authors, not of Uniqtech. Please read our disclaimers before using our content. This applies to all of our contents, channels and websites. 

Mentioning a crypto, stock does not mean endorsement. This is not financial advice. We do not have financial advisory licenses. Do your own research. Cryptos and stocks are very risky. All contents here are hypothetical, informational, educational purpose only. 

We may own said crypto. 




Play to Earn Blockchain, Crypto, NFT Games

In this article we will discuss the Play-to-Earn Economy, aka P2E.  Perhaps the most famous play to earn game is Axie Infinity, which amassed 1 million Daily Active Users (DAU). Its protocol revenue is only second to Ethereum, wow. 

Too busy to read? Watch this youtube documentary about Axie Infinity: https://youtu.be/Yo-BrASMHU4
The video explaining play to earn went somewhat viral. People in struggling communities are playing Axie Infinity to change their life. 

The concept play-2-earn is also connected with the idea of Metaverse, real estate NFT, in-game purchase, in-game economy etc.

How does Axie Infinity make money? | How does Axie Infinity earn fees

"The Axie Infinity economy consists of a governance token (AXS) and a second token called Smooth Love Potion (SLP) that serves as an in-game currency, along with NFTs that represent both game characters and virtual real estate." - coinbase

"Every time an Axie is traded, a plot of real estate is sold, or two Axies are bred, the protocol takes a fee priced in a combination of AXS and SLP. Rather than go to the developers, this revenue is placed in the Axie treasury, which has ballooned to nearly $600 million."

Axie Infinity is not actually available in the United States. Its enormous success was based on emerging markets alone: Vietnam, Philippines, Brazil, India, Indonesia, Venezuela  etc.

Games of web2, pre blockchain games, employs the free-to-play, or freemium model. It's to get started. Axie Infinity requires 3 to get started. You will have to do buy, rent, or obtain an AxieInfinityScholarship in order to get started. When the game first started, Axies average $10 per creature, now it is estimated to be north of $500 per creature.

Of course $1500 is not affordable at all for people in the Philippines. There are now systems of lending: when lending axies to others, the loan originator also gets a cut of the winning. You can think of this as a credit, borrowing / banking system build on top of the game. However, it is also smelling of pyramid when gamers have to pay to join and thus by recruiting new members, the game becomes more profitable for those at the top of the pyramid. 

Yield Guild Games (YGG) "YGG is essentially a holding company for play-to-earn gaming assets. Starting in 2020, they’ve been buying up yield producing NFTs, governance tokens, and ownership stakes in promising gaming projects and protocols." - coinbase "Similar to how Uber pairs people who want to earn money driving with people who need rides, YGG pairs people who want to make money gaming with the NFTs they need to earn in play-to-earn games." YGG even has its own asset report https://medium.com/yield-guild-games/yield-guild-games-asset-treasury-report-july-2021-62f3a969d223 (July) " By the end of July, the YGG treasury had amassed 19,460 NFTs valued at over $10M across 12 play-to-earn games. Axie Infinity NFTs comprised close to 90% of that value."

With Sandbox's huge raise recently, we wonder if YGG has increased again, significantly in value. YGG also has a token. If you are interested in NFTs and games, it might be good to look at YGG's portfolio for brainstorming ideas. "YGG has also made early stage investments across 8 play-to-earn games via SAFT (Simple Agreement for Future Tokens)". May be this name is inspired by YCombinator SAFE? 

Seriously best article about GameFi by coinbase blog https://blog.coinbase.com/axie-infinity-yield-guild-games-the-play-to-earn-economy-e73ac6b39e6c

Federal regulator in the gaming world? Product managers of games long know that in-game economy can be regulated. Players can be incentivised or disincentivised to certain activities. In Axie Infinity, the Fed is called the Sky Mavis.

"If Axie Infinity is its own digital nation, game developer Sky Mavis serves as its Federal Reserve. Where the Fed has various tools it uses to influence the economy, Sky Mavis can adjust the SLP issuance rate and breeding fees with the aim of keeping the Axie economy healthy. Just like a real economy, digital economies have to consider the effects of inflation."

For those already overwhelmed by the amount of information out there, a simple rule to keep in mind is axies are bought using Ethereum. If you want a part of the Axie Infinity earn but don't have time to learn one more thing. Consider Ethereum as your asset. Not financial advice, not qualified to give financial advice. WARNING Read our full disclaimer.  WARNING

People have been using the analogy Ready Player One over and over again: where people living in dystopia can have their lives changed by their in-game performance in the metaverse where they play to earn. It's an exciting time and it is a sad time. Fortune rarely honors those who gamble or try to make-rich-quick-scheme. But for now, it's an exciting time to be a gamer. 

Read more about Axie Infinity on coinbase, source 2 below

Source:

https://blog.coinbase.com/axie-infinity-yield-guild-games-the-play-to-earn-economy-e73ac6b39e6c

https://www.coinbase.com/learn/crypto-basics/what-is-axie-infinity

Friday, November 12, 2021

Blockchain NFT Cryptocurrency Hackathon Resources

Blockchain, cryptocurrency, NFT concepts explained to developers. Understand the technical side of blockchain technology. Learn more about Web3 economy including Dapps, DeFi, DAOs, DEXs, GameFi, smart contracts. Decentralized tech with crypto and smart contracts can potentially provide transparency, trust, consensus, guaranteed execution. The crypto part makes the system potentially difficult if not impossible to manipulate / influence.         

What is Blockchain? "Blockchain is the innovative database technology that's at the heart of nearly all cryptocurrencies" - David Rodeck, John Schmidt. "By distributing identical copies of a database across an entire network, blockchain makes it very difficult to hack or cheat the system." 

Blockchain technology is useful not just for cryptocurrency. There are many new innovative application, usage of blockchain tech.

Blockchain: ideally blockchain technology is decentralized into a large network of nodes, where it'd be hard for a single party to take over a large number of nodes /computers. There's trust in the tech, security, and ability to execute the exact contract. "Decentralization solves the trust problem through redundant data validation." - From Technology to Society: An Overview of Blockchain-Based DAO. A public ledger. Sometimes double entry ledger. 区块链 - blockchain

Crypto: scarcity - can have limited supplies like Bitcoin. Divisibility of money can generate smaller denominations.

Crypto Kitty: one of the early successful, massive NFT games. 

Consensus: consensus model.  money is a consensus mechanism - MIT. 

Crypto Cities: ethereum creator Vitalik Buterin discusses crypto cities and political DAOs on his personal blog. Vitalik  Buterin on Crypto Cities

DAO : Decentralized Autonomous Organization (DAO). in a typical DAO, each token carries some form of voting rights. Every token is like a vote. Gives rise to e-governance and the concept of governance coins.

Dapps: decentralized apps

DeFi: decentralized finance. An example is stablecoins, lending and borrowing, trading on dencentralized exchanges. Without the middleman, such as a bank.. 

DEX: decentralized exchange.

Dogecoin nodes recently upgraded to version 

Ethereum: the famous cryptocurrency that powers many top NFTs and DeFi apps. Year 2015

Gas fee: 

Ledger: transaction ledger, balance ledger

Mainnet vs Testnet: Mainnet is the live, production environment with the actual ledger. Testnet uses testnet tokens, for development experimental work. will be recorded but is for testing. A example testnet for ethereum Ropsten test network. 

Mining

NFT: 不可替代令牌, 中文名叫非同质化通证 数字艺术品 - digital art

OpenSea: is perhaps the largest NFT art platform and e-commerce site. 

Oracle : one use case for oracle is for checking crypto conversion price before completing a payment. 

Proof of work

Proof of stake

Smart contract: a piece of code that executes to ensure the rules and exact actions are taken during a transaction. Can be used to guarantee execution. 

Solidity is the code for smart contracts. It has java like syntax. 

Statistics: useful statistics how many blocks in the blockchain. how many blocks are added per minute / interval / duration.

Tokens and blockchains you may encounter at hackathons:

Metis Layer 2, Solana, ICON, 

Tokens that are useful :

Metis can support DAO. Mobile first tokens/blockchains include : Celo, PiCoin

Transaction speed: 

Projects:

Neighborhood hacks : build a blockchain tacoshop with Ark.io

Read the full disclaimer. Not financial advice. Not for trading use. Hypothetical discussions only. Informational only.

https://www.siliconvanity.com/2021/11/blockchain-crypto-stock-personal.html

Disclaimer: My company and I may both own crypto currency. All discussed is for informational purpose only. Crypto and blockchain, NFT, gaming are highly risky spaces. These are not financial advice. Risky investment may incur lost of investment and the entire principal. All discussion of technology is for informational purpose only. Mentioning a tech does not mean endorsement. All tutorials are for informational purpose only, cannot be used for commercial nor production use. Have not been tested for security. Using blockchain, cloud or machine learning technology may incur high costs. We are not responsive for costs, damage associated with any of these technology. You may want to monitor the cost, and set budget alarms and quotas whenever possible. 


Thursday, November 11, 2021

NFT why do people want it?

 How are NFT used to provide owners desirable social and wealth status?

  • Top NFTs are so expensive, it clearly showcase multi-millionaire status. Bored ape yacht club has no NFT below $100,000
  • People use their crypto punk and ape NFT as social media profile picture and even speaker photo at NFT and decentralized conference 
  • VIP a exclusive access to art, social, party events. Example: bored ape yacht club actually hosted a yacht party at NFTNYC
  • Community : owners join private club , lounge in the form of digital forums such as Discord server. 
  • NFTs are collectible by nature. Each attribute has different level of rarity. 
  • NFTs are digitally scarce art. They are not scarce physically, because one can right click and save and make copies. There's even running joke about right-click-and-save. 

For all our crypto articles please read our disclaimer first

https://www.siliconvanity.com/2021/11/blockchain-crypto-stock-personal.html?m=1

Tuesday, November 9, 2021

Blockchain, crypto, stock, personal finance DISCLAIMER WARNING

WARNING, Disclaimer IMPORTANT: My company and I may both own crypto currency, NFT and other blockchain related products. We may currently or in the future invest in crypto, blockchain, NFT, token related companies.  All discussed is for informational purpose only. Crypto and blockchain, NFT, gaming are highly risky spaces. These are not financial advice. Risky investment may incur lost of investment and the entire principal. All discussion of technology is for informational purpose only. Mentioning a tech does not mean endorsement. All tutorials are for informational purpose only, cannot be used for commercial nor production use. Have not been tested for security. Using blockchain, cloud or machine learning technology may incur high costs. We are not responsive for costs, damage associated with any of these technology. You may want to monitor the cost, and set budget alarms and quotas whenever possible. Not financial advice. Always do your own thorough research before investing. I am not a professional. Blockchain technology changes all the time, our post may be out of date, inaccurte, unusable, or not secure. Please always check with the underlining technology documentation for the latest, greatest, official guidance. Our posts are for informational purpose only. We will NOT be responsible for any issues, nor damages, nor losses. 

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid