Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafaelfgx/blockchain
Blockchain, Wallet, Smart Contracts, Token, NFT, SBT, Solidity.
https://github.com/rafaelfgx/blockchain
blockchain crypto cryptocurrency nft smart-contracts solidity token wallet
Last synced: 3 months ago
JSON representation
Blockchain, Wallet, Smart Contracts, Token, NFT, SBT, Solidity.
- Host: GitHub
- URL: https://github.com/rafaelfgx/blockchain
- Owner: rafaelfgx
- License: mit
- Created: 2021-07-03T14:07:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T22:24:53.000Z (3 months ago)
- Last Synced: 2024-11-12T23:24:58.601Z (3 months ago)
- Topics: blockchain, crypto, cryptocurrency, nft, smart-contracts, solidity, token, wallet
- Language: Solidity
- Homepage:
- Size: 8.79 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# Blockchain
Transaction ledger (digital, decentralized, distributed, immutable and public).
## Consensus Algorithm
Validate and confirm transactions to add a block to the chain.
### Proof of Work (PoW)
First consensus algorithm.
Miner solves a complex hashing puzzle using computational processing, requiring huge amounts of energy.
Mining reward is paid to the miner who solves the puzzle first.
Attacker needs to have computational processing more powerful than 51% of the network to tampering the chain.
Susceptible to a future Tragedy of Commons. Reward decreases over time, making it possible to own 51% of the network.
### Proof of Stake (PoS)
Alternative to Proof of Work due to energy consumption.
Block creator is chosen based on your stake. The more the stake, the more the chance.
Block creator takes a transaction fee as reward.
Attacker needs to own 51% of the network to tampering the chain.
Not susceptible to a Tragedy of Commons. The more the stake, the more discouraged to tampering the chain.
## Example
```json
{
"Chain": [
{
"Index": 0,
"DateTime": "2021-07-03T21:59:46.2845741Z",
"Hash": "1T6f21MYYemsxI4EKEV6wyX2wlXTqDkfsnb/pTB4bLM="
},
{
"Index": 1,
"DateTime": "2021-07-03T21:59:46.3233224Z",
"Transactions": [
{
"From": "bob",
"To": "alice",
"Amount": 10
},
{
"To": "miner",
"Amount": 1
}
],
"PreviousHash": "1T6f21MYYemsxI4EKEV6wyX2wlXTqDkfsnb/pTB4bLM=",
"Hash": "9zwBP6QXAk3TQ4aWqfvnJRBDtUjkdJXxmZZ0CXSIX/k="
},
{
"Index": 2,
"DateTime": "2021-07-03T21:59:48.5104227Z",
"Transactions": [
{
"From": "bob",
"To": "eve",
"Amount": 20
},
{
"From": "alice",
"To": "eve",
"Amount": 30
},
{
"To": "miner",
"Amount": 1
}
],
"PreviousHash": "9zwBP6QXAk3TQ4aWqfvnJRBDtUjkdJXxmZZ0CXSIX/k=",
"Hash": "AJkcd/xYNVQ0dmlyn0yYImcriy3OEO0qjgMp8dTsIz8="
}
],
"Valid": true
}
``````js
node wallet.mjs
``````js
npx hardhat init
npx hardhat node
npx hardhat clean
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.js
```[Token 2049](https://www.token2049.com)
[Decentralized Trust](https://www.lfdecentralizedtrust.org)
[Hardhat](https://hardhat.org)
[Remix](https://remix.ethereum.org)
[Solidity](https://docs.soliditylang.org)
[Ethereum Improvement Proposals](https://eips.ethereum.org)
[OpenZeppelin](https://www.openzeppelin.com)
[OpenZeppelin Wizard](https://wizard.openzeppelin.com)
[Ethers.js](https://docs.ethers.org)
[Web3.js](https://docs.web3js.org)
[InterPlanetary File System](https://ipfs.tech)
[Bitcoin Blockchain Explorer](https://blockstream.info/testnet/address/ADDRESS)
[Bitcoin Testnet Faucet](https://bitcoinfaucet.uo1.net)
[Bitcoin Wallet](https://electrum.org)