Building decentralized apps with Blockstack
Introduction
I’m Hank Stoever Engineering Partner at Blockstack working on:
Introduction
During this talk, I’ll explain:
How do we enable decentralization?
At Blockstack, we’re building the assets needed for a new internet.
How is it different?
Build apps fast, without managing infrastructure
Blockstack Identity (auth layer)
Gaia (storage layer)
How does this compare to Ethereum dapps?
Ethereum Apps:
Blockstack Apps:
Notable projects built on Blockstack
Using blockstack.js - Authentication
blockstack.redirectToSignIn() // Initial Sign in
if (blockstack.isUserSignedIn()) {
const userData = blockstack.loadUserData()
// handle handle userData
} else if (blockstack.isSignInPending()) {
blockstack.handlePendingSignIn().then((userData) => {
// handle userData
})
}
blockstack.signUserOut()
Using blockstack.js - Storage
blockstack.putFile(‘myfile.json’, myJsonString, { encrypt: true });
blockstack.getFile(‘myfile.json’, { decrypt: true })
// Public data:
const origin = window.location.origin
blockstack.redirectToSignIn(origin, origin + '/manifest.json', ['store_write', 'publish_data'])
blockstack.putFile(‘myfile.json’, myJsonString, { encrypt: false });
blockstack.getFile(‘myfile.json’, { decrypt: false, username: ‘hankstoever.id’})
Using Blockstack - App generators
https://github.com/blockstack/blockstack-app-generator
npm install -g yo generator-blockstack
mkdir hello-blockstack && cd hello-blockstack
yo blockstack:react
npm run start
Future considerations for developer tooling
Help out, we’re always looking for code contributions and new community packages!
Blockstack Contributor Platform
Get paid in STACKs to contribute to Blockstack
Thanks!
hank@blockstack.com
www.blockstack.org