SlideShare a Scribd company logo
Blockchain
com
JavaScript
Sou Beto Muniz
@obetomuniz
https://developers.google.com/experts/people/beto-muniz
Sou Beto Muniz
@obetomuniz
minasdev.org
Blockchain com JavaScript
import SHA256 from "js-sha256"
class Block {
constructor(index, data, previousHash) {
this.index = index
this.timestamp = new Date()
this.data = data
this.previousHash = previousHash
this.hash = this.calcHash()
}
calcHash() {
const sha = SHA256.create()
sha.update(`${this.index}${this.timestamp}${this.data}${this.previousHash}`)
return sha.hex()
}
static generator(block = { index: 0, hash: "0" }, data = "genesis") {
return new Block(block.index, data, block.hash)
}
}
https://github.com/openblockchains/awesome-blockchains/blob/master/blockchain.js/blockchain.js
Blockchain com JavaScript
Blockchain com JavaScript
Blockchain
“Cadeia de Blocos”
História
do Blockchain
2008O conceito é publicado por Satoshi Nakamoto
2009Começa a blockchain Bitcoin
2014Surge o termo “Blockchain 2.0”
2015Surge a blockchain Ethereum
Criada por Vitalik Buterin
2016+1 bilhão de dólares investidos
https://www.businessinsider.com/blockchain-technology-is-already-a-1-billion-dollar-industry-and-its-just-the-beginning-2016-6
2018+1600 criptomoedas
+500 bilhões de reais de valor de mercado
+2000 aplicações descentralizadas na Ethereum
https://en.wikipedia.org/wiki/List_of_cryptocurrencies https://coinmarketcap.com | https://www.stateofthedapps.com
2019???
Conceito
Blockchain
É um banco de dados distribuído com
uma lista (chain) de registros (blocks)
interligados e seguros (linked hashes)
Linked Hashes?!
Crypto Hashes.
E
como funciona?
Hashing
Criptografia
P2P Network
Nodes
Assinaturas Digitais
Proof of Steak
Proof of Authority
Turing Completude
InterPlanetary File System
Consensus Protocols
Delegated Proof of Stake
Byzantine Fault Tolerance
Proof of Work
Smart Contracts
Sidechains
Tokens
ÐApps
Consortium blockchains
Blockchain com JavaScript
Mas então como
aprender Blockchain?
Blockchain com JavaScript
A natureza da conceito
blockchain não é linear
E na prática…
Composição
de conceitos
Blockchain com JavaScript
Bitcoin
blockchain
Hashing
Criptografia
P2P Network
Nodes
Moeda Digital
Proof of Work
Imutabilidade
Ethereum
blockchain
Smart Contracts
Criptografia
ÐApps
Turing Completude
Tokens
Proof of Steak
Imutabilidade
Blockchain NÃO é o Bitcoin 

Bitcoin É um caso de uso do conceito blockchain
BlockchainS
“CadeiaS de Blocos”
https://votolegal.com.br
Justiça Eleitoral
https://www.techrepublic.com/article/ibm-taps-blockchain-to-combat-food-contamination-in-global-supply-chain
Logística
https://www.techrepublic.com/article/why-blockchain-could-be-your-next-form-of-id-as-a-world-citizen
Crises Humanitárias
https://techcrunch.com/2017/04/26/spotify-acquires-blockchain-startup-mediachain-to-solve-musics-attribution-problem
Música e Streaming
https://www.criptomoedasfacil.com/odebrechet-cria-ferramenta-blockchain-para-monitorar-licitacoes-em-acordo-com-o-ministerio-publico-federal
Anti-Corrupção Política
https://www.bndes.gov.br/wps/portal/site/home/imprensa/noticias/conteudo/bndes-lanca-consulta-publica-em-busca-de-componentes-blockchain-para-o-bndestoken
Gestão Pública
https://www.iota.org/get-started/what-is-iota
Internet das Coisas
Blockchain com JavaScript
Transparência de dados
Governança Descentralizada
Performance
Segurança
Privacidade*
Rastreabilidade de Informação
Imutabilidade
Escalabilidade
Tokenização
Aplicabilidade
…
Open Source
Comunidade
Baixo Custo
Como Aplicar?!
JavaScript
História
do JavaScript
Blockchain com JavaScript
Blockchain com JavaScript
Blockchain com JavaScript
Blockchain com JavaScript
Blockchain com JavaScript
Blockchain com JavaScript
JAVASCRIPT
EVERYWHERE
Aplicações Mobile Nativas
Browser
Aplicações para SmartTVs
Banco de Dados
Aplicações de Linha de Comando
Aplicações Desktop
Sistemas Operacionais
Blockchain
Servidor
Games*
Progressive Web Apps
Internet das Coisas
Utilizada por grandes empresas
Ecossistema vasto
Multiparadigma
Gerada para um mundo conectado
Fácil de iniciar os estudos
Mercado abundante e generoso
Melhoria contínua
Comunidade vibrante e ativa
…
Auxilia no aprendizado de outras linguagens
Linguagem mais popular do mundo
20192020, 2021, …
Blockchain com JavaScript
JavaScript
+

Blockchain
Ethereum
“com” JavaScript
https://www.ethereum.org
Smart Contracts
https://www.ethereum.org
https://www.ethereum.org/token
pragma solidity ^0.4.20;
contract DevFestToken {
mapping (address => uint256) public balanceOf;
function DevFestToken(uint256 initialSupply) public {
balanceOf[msg.sender] = initialSupply;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value);
require(balanceOf[_to] + _value >= balanceOf[_to]);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
return true;
}
}
https://github.com/s-tikhomirov/smart-contract-languages
Vyper
Solidity
LLL - Lisp*
Ethereum bytecode
Bamboo
eWASM - WebAssembly*
Serpent - Python*
SolidityX
Pyramid
Flint
Yul
Babbage
Mutan - C*
Idris
Lolisa
L4
Formality
Logikon
ÐApps
Aplicações Descentralizadas
https://www.ethereum.org
Distribuídas
Micro Services
Descentralizadas
Blockchains
Centralizadas
Ponto de Falha Único
https://www.ethereum.org
web3.js
Ethereum JavaScript API
https://github.com/ethereum/web3.js
import web3 from "web3"
const ORIGEM = “0xf4e36a1c193e687b459f22d3512dd0cfec289fd3"
const DESTINO = "0xcc16e3c00dbbe76603fa833ec20a48f786dfe611"
const DevFestTokenSmartContract = "0xcc16e3c00dbbe76603fa833ec20a48f786dfe610"
const DevFestTokenABIObject = { ... }
const SmartContract = await new web3.eth.Contract(
DevFestTokenABIObject,
DevFestTokenSmartContract
)
SmartContract.methods.transfer(DESTINO, 1).send({ from: ORIGEM })
Blockchain com JavaScript
Arkcom JavaScript
https://ark.io
https://ark.io
Arkcom JavaScript, PHP, Swift, Go, .NET, Python, Java, …
ark-js
Ark Blockchain Client
https://github.com/ArkEcosystem/ark-js
https://marketplace.arkaces.com/dashboard
Hyperledger
com JavaScript
https://www.hyperledger.org
Chaincode
https://www.hyperledger.org
import shim from "fabric-shim";
class Chaincode {
Init(stub) {
return stub
.putState("chave", Buffer.from("valor"))
.then(() => shim.success(), () => shim.error());
}
Invoke(stub) {
return stub.getState("chave").then(() => shim.success());
}
};
shim.start(new Chaincode());
https://www.hyperledger.org
Lisk
100% JavaScript
https://lisk.io
https://blog.github.com/2018-11-15-state-of-the-octoverse-top-programming-languages | https://insights.stackoverflow.com/survey/2018
Sidechain
https://lisk.io
Blockchain com JavaScript
Blockchain com JavaScript
Obrigado!
@obetomuniz
https://github.com/openblockchains/awesome-blockchains/blob/master/blockchain.js/blockchain.js

https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b

https://github.com/openblockchains/awesome-blockchains/blob/master/BITCOIN-BITCOIN-BITCOIN.md

https://lisk.io/academy

https://github.com/openblockchains/awesome-blockchains

https://portaldobitcoin.com/marina-silva-usa-blockchain-para-financiar-campanha-e-arrecada-r-100-mil-em-quatro-dias/

https://www.techrepublic.com/article/6-ways-companies-are-using-blockchain-to-drive-value-right-now/

https://lisk.io/academy/blockchain-basics/use-cases

https://appleinsider.com/articles/17/04/26/spotify-buys-blockchain-startup-mediachain-labs-to-track-manage-music-royalties

https://betomuniz.com/blog/blockchain-e-javascript/

https://en.wikipedia.org/wiki/Blockchain

https://www.fintech.finance/featured/blockchain-5-key-concepts/

https://tradeix.com/essential-blockchain-technology-concepts/

https://medium.com/@mycoralhealth/advanced-blockchain-concepts-for-beginners-32887202afad

https://novoconsenso.com/bndes-quer-financiar-obra-com-token-na-blockchain-do-ethereum-3d48ff1029c1

https://livecoins.com.br/diferenca-de-token-e-criptomoedas/

http://iotafeed.com/portugues/index.php/2017/12/10/esqueca-bitcoin-iota-faz-parceria-com-5-empresas-de-sucesso-em-um-novo-projeto/

https://www.coindesk.com/information/what-is-the-difference-blockchain-and-database/

https://www.coindesk.com/information/why-use-a-blockchain/

https://lisk.io/academy/blockchain-basics/benefits-of-blockchain

https://www.coindesk.com/information/applications-use-cases-blockchains/

https://www.extremetech.com/extreme/265480-tell-use-blockchain-application

https://www.criptomoedasfacil.com/cofundador-do-ethereum-afirma-que-a-blockchain-impactara-a-sociedade-mais-do-que-a-internet/

https://github.com/raphamorim/react-ape

https://pt.stackoverflow.com/questions/126886/qual-%C3%A9-o-paradigma-de-programa%C3%A7%C3%A3o-usado-pelo-javascript

https://pt.stackoverflow.com/questions/77070/qual-a-diferen%C3%A7a-entre-linguagem-compilada-para-linguagem-interpretada

https://fossbytes.com/why-learn-javascript-reasons/

https://codenaturally.com/7-reasons-we-love-javascript/

https://www.criptomoedasfacil.com/odebrechet-cria-ferramenta-blockchain-para-monitorar-licitacoes-em-acordo-com-o-ministerio-publico-federal/

https://www.techrepublic.com/article/why-blockchain-could-be-your-next-form-of-id-as-a-world-citizen/

https://www.techrepublic.com/article/ibm-taps-blockchain-to-combat-food-contamination-in-global-supply-chain/

https://votolegal.com.br/

https://novoconsenso.com/bndes-quer-financiar-obra-com-token-na-blockchain-do-ethereum-3d48ff1029c1?gi=97e804781efa

https://www.iota.org/get-started/what-is-iota

https://blog.github.com/2018-11-15-state-of-the-octoverse-top-programming-languages/

https://www.simplilearn.com/top-technology-trends-and-jobs-article
Referências

More Related Content

PDF
Talk about html5 security
PDF
PPTX
Data Management 2: Conquering Data Proliferation
PDF
MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 Link
PPT
WebSocket JSON Hackday
PDF
Building interactivity with websockets
PDF
Javascript Object Signing & Encryption
PPTX
Oracles
Talk about html5 security
Data Management 2: Conquering Data Proliferation
MongoDB World 2019: Using Client Side Encryption in MongoDB 4.2 Link
WebSocket JSON Hackday
Building interactivity with websockets
Javascript Object Signing & Encryption
Oracles

Similar to Blockchain com JavaScript (20)

PPTX
Oracles
PDF
Getting insights from IoT data with Apache Spark and Apache Bahir
KEY
OSCON 2011 CouchApps
PPTX
Soaring through the Clouds - Oracle Fusion Middleware Partner Forum 2016
PPTX
Hazelcast and MongoDB at Cloud CMS
PPTX
Event-driven IO server-side JavaScript environment based on V8 Engine
PDF
Securing TodoMVC Using the Web Cryptography API
PPTX
Developing your first application using FIWARE
PPT
HTML5 WebSocket: The New Network Stack for the Web
PDF
Building decentralised apps with js - Devoxx Morocco 2018
PDF
Token platform based on sidechain
PDF
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
PDF
Scalaで実装してみる簡易ブロックチェーン
PDF
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
PDF
Implementing and Visualizing Clickstream data with MongoDB
PDF
What's the deal with Android maps?
PPTX
DevSum'15 : Microsoft Azure and Things
PPTX
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
PPT
Pushing the Boundaries of Sencha and HTML5′s WebRTC
PDF
Web3Hub-GDSC presentation.pdf
Oracles
Getting insights from IoT data with Apache Spark and Apache Bahir
OSCON 2011 CouchApps
Soaring through the Clouds - Oracle Fusion Middleware Partner Forum 2016
Hazelcast and MongoDB at Cloud CMS
Event-driven IO server-side JavaScript environment based on V8 Engine
Securing TodoMVC Using the Web Cryptography API
Developing your first application using FIWARE
HTML5 WebSocket: The New Network Stack for the Web
Building decentralised apps with js - Devoxx Morocco 2018
Token platform based on sidechain
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
Scalaで実装してみる簡易ブロックチェーン
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
Implementing and Visualizing Clickstream data with MongoDB
What's the deal with Android maps?
DevSum'15 : Microsoft Azure and Things
MongoDB.local Atlanta: MongoDB Mobile: Bringing the Power of MongoDB to Your ...
Pushing the Boundaries of Sencha and HTML5′s WebRTC
Web3Hub-GDSC presentation.pdf
Ad

More from Beto Muniz (16)

PDF
"Comunidade não dá dinheiro"
PDF
Web Underground
PDF
Progressive Web Apps in Depth
PDF
Remote Work! Less Stress, More Productivity.
PDF
Tecnologia e Empreendedorismo. A fórmula de sobrevivência de qualquer ideia.
PDF
Comunidade. Abuse e use dela com moderação e inteligência.
PDF
Polymer Elements: Tudo que você precisa saber para criar a web
PDF
WebApps com Web Components
PDF
Desmistificando o Polymer
PDF
Martini. O Um framework web para Go
PDF
SASS e Compass, O CSS Ninja Workflow
PDF
Web Components, A próxima revolução do desenvolvimento web.
PDF
O Poderoso AngularJS
PDF
Ampliando suas fronteiras com Node-Webkit
PDF
Construindo um Servidor Web com GO
PDF
Express 4
"Comunidade não dá dinheiro"
Web Underground
Progressive Web Apps in Depth
Remote Work! Less Stress, More Productivity.
Tecnologia e Empreendedorismo. A fórmula de sobrevivência de qualquer ideia.
Comunidade. Abuse e use dela com moderação e inteligência.
Polymer Elements: Tudo que você precisa saber para criar a web
WebApps com Web Components
Desmistificando o Polymer
Martini. O Um framework web para Go
SASS e Compass, O CSS Ninja Workflow
Web Components, A próxima revolução do desenvolvimento web.
O Poderoso AngularJS
Ampliando suas fronteiras com Node-Webkit
Construindo um Servidor Web com GO
Express 4
Ad

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Big Data Technologies - Introduction.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Assigned Numbers - 2025 - Bluetooth® Document

Blockchain com JavaScript