[爆卦]web3瀏覽器是什麼?優點缺點精華區懶人包

雖然這篇web3瀏覽器鄉民發文沒有被收入到精華區:在web3瀏覽器這個話題中,我們另外找到其它相關的精選爆讚文章

在 web3瀏覽器產品中有2篇Facebook貼文,粉絲數超過3,460的網紅Taipei Ethereum Meetup,也在其Facebook貼文中提到, 📜 [專欄新文章] Solidity Weekly #20 ✍️ mingderwang 📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium Metamask “Privacy Mode”...

  • web3瀏覽器 在 Taipei Ethereum Meetup Facebook 的最讚貼文

    2018-12-01 12:51:17
    有 5 人按讚


    📜 [專欄新文章] Solidity Weekly #20
    ✍️ mingderwang
    📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium

    Metamask “Privacy Mode”

    前一陣子,Metamask 與其他幾家 Ether 數位錢包公司,為了安全起見,決定改變叫用帳號的流程。舊的 Ðapp 網站需要改寫,才能搭配使用,這裏來做個介紹。

    Breaking Change: No Accounts Exposed by Default,這篇文章有做完整的說明,從 2018 年 11 月 6日起,Metamask plugin 錢包與 Status,Mist,以及 ImToken 計畫一起提供一個新而且更安全的方法 (EIP-1102),來讀取錢包帳號的資料,例如它的 balance,交易歷史,以及一些敏感資料,未來錢包的 “Privacy Mode” 將預設為開啟。也就是在使用舊有的 Ðapp 網頁, Metamask “Privacy Mode” 必須是關閉,才能跟以前一樣使用,直接可讀取 Metamask 裡的帳號資料,進行交易。

    對程式設計師而言,簡單講就是要叫用一個新的 ethereum.enable() function,它會 return 一個 Promise。如果 user 同意讓 Ðapp 使用他的帳號, 就會回傳 provider 結果,否則回傳 Error。這個 ethereum 物件,是 Metamask 在啟動時,會加到瀏覽器的 window 裡的,所以程式範例如下(僅供參考, 它還可以寫得更好);

    import Web3 from ‘web3’

    let web3;

    if (typeof web3 !== ‘undefined’ && window.ethereum) {

    const ethereum = window.ethereum;

    ethereum.enable().then((account) => {

    const defaultAccount = account[0]

    console.log(defaultAccount);}).error(console.log);

    web3 = new Web3(web3.currentProvider);// orweb3 = new Web3(ethereum);

    } else {console.log('maybe user does not install metamask');

    // set the provider you want from Web3.providers

    web3 = new Web3(new Web3.providers.HttpProvider(“http://localhost:8545"));

    }

    v4.14.0 版以後的 Metamask,provider 的 window.ethereum 就開始支援 enable() function,只是預設值是關閉的。

    如上圖,新版 MetaMask v5.0.x 設定裡也已經可以看到 Privacy Mode 的開關。目前版本的預設是關著的。以後新版將會預設成開。有些舊 ÐApp 網站沒搭配著修改,就無法使用。但為了相容起見,user 關掉 Privacy Mode,還是能正常使用,但這樣對使用者來講就不安全了。

    這個標準定義在 EIP-1102,想深入了解底層的開發者可以參考。

    相關 Links:

    EIP-1102: How to prepare your dapp

    Tutorial — How To Connect A JavaScript Front-End To A Smart Contract On Ethereum

    Solidity Weekly #20 was originally published in Taipei Ethereum Meetup on Medium, where people are continuing the conversation by highlighting and responding to this story.

    👏 歡迎轉載分享鼓掌

  • web3瀏覽器 在 Taipei Ethereum Meetup Facebook 的最佳貼文

    2018-10-14 02:47:16
    有 8 人按讚


    📜 [專欄新文章] Solidity Weekly #15
    ✍️ mingderwang
    📥 歡迎投稿: https://medium.com/taipei-ethereum-meetup #徵技術分享文 #使用心得 #教學文 #medium

    真的 Dapps 怎麼做?

    這裡我所謂的”真的” Dapps,是希望真能達到 decentralized apps 的目的,也就是不再需要任何網站 (https server) 來存放你的合約介面程式。也許有些人會覺得沒有必要真的完全 decentralized 吧,連 CryptoKitties 都沒做到,不是也一樣賣得嚇嚇叫!

    但有多少網站連結最後都因為沒人維護而消失在 link 的另一端,有些好遊戲;也因為經營者不玩了,造成玩家所有的努力都付之一炬,不是很令人失望且有點可惜嗎?

    目前我們可以利用 IPFS 來存放 html 與 js 或其他 asset 檔案,就可少去 web 伺服器永遠存在的必要性,未來 (我猜) 幾乎瀏覽器會支援某種類似 IPFS 的 proxy,就像現在支援 cache 一樣,無形中加速 IPFS 檔案的下載,至少 users 感覺會好一點。(註: 目前 IPFS 還是有點慢)

    這個 Ropsten Testnet Ether 水龍頭 https://ipfs.io/…/QmVAwVKys271P5EQyEfVSxm7BJDKWt42A2gHvNmx…/ 就是一個沒有用 https server 的 DApp 例子。

    當然要把複雜的 Javascript 程式包到 html 裡或簡單的單檔 JS 裡需要一點技巧。但我想難不倒我們台灣的大部分的前端工程師。

    shared links:

    Build a simple Ethereum + InterPlanetary File System (IPFS)+ React.js DApp.

    https://itnext.io/build-a-simple-ethereum-interplanetary-fi…

    Ming> 本文確確實實一步ㄧ步地教你如何結合 IPFS 與 web3.js 1.0 撰寫 DApp 上傳檔案到 IPFS,並記錄的 Ethereum blockchain。(但沒介紹如何安裝 DApp 在 IPFS 上)。

    PS. 另一個方法就是用 react native (Expo) + web3.js 寫成手機 app。下週 Solidity Weekly 再來分享。(如果未來每個人的手機,可以像 mp3 世界裡的 azureus p2p 方式下載 Dapps 軟體,應該也算是 decentralized 吧)

    Solidity Weekly #15 was originally published in Taipei Ethereum Meetup on Medium, where people are continuing the conversation by highlighting and responding to this story.

    👏 歡迎轉載分享鼓掌

你可能也想看看

搜尋相關網站