or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Dapp 跨平台相容性解決方案 - Mars Peng
歡迎來到 JSDC 2018 共筆
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →共筆入口:https://hackmd.io/c/JSDC2018
手機版請點選上方 按鈕展開議程列表。
另外點選筆記中的 符號就可以直接對那個段落補充或留下意見哦!
tags:
jsdc2018
Dapp 不過就是個 WebApp ?
> 是也不是,Dapp 的確是 WebApp 但是還做了很多不同的事
Web 3.0 除了不同螢幕、不同瀏覽器,還有不同的錢包
Dapp 的所處環境
Desktop
Dapp 是在 Chrome 瀏覽器上執行透過 Extension 溝通跟區塊鏈溝通
Mobile
透過 Dapp Browser,其實 只是個 webView 但是外層有個 PKey Manager ,透過這個跟區塊鏈溝通,確保 web 不會取得 PKey
Web3 & Ethereumjs-tx
Web3 -> 打 JSON RPC API
Ethereumjs-tx 用來 sign transaction
Web3 & Provider
提供兩個方法
如果是在錢包的環境,Provider 會由錢包自動提供,錢包會做一個 Hook ,在 web 呼叫所有 RPC 方法,錢包才能監聽的到。
Wallet Web3 Provider Type
每個錢包都有自己的 Provider
大致上有三種模式:
錢包運作原理
Export PKey 會在 Dapp 中跳 confirm UI,程式會直接拿到 PKey,這很危險
雖然用戶不用安裝錢包,但是安全性方面會有問題
Im Token 自己有自己的 SDK,sendAsync 跟其他的人不一樣
web3 認為合法的 transaction 在 im token 可能不合法
Im Token 的 provider 不是原生的,是自己改的
我們喜歡 web socket 但不幸的目前幾乎市面上的錢包都是 HTTP
WS Provider
手機網路不穩,會讓交易失敗
三段式交易