Change svg color

Open your svg file and you’ll see code like below :

<path class="svgpath" data-index="path_0" fill="#ffffff" d="M0 525.2c0 223.6 143.3 413.7 343 483.5 26.9 6.8 22.8-12.4 22.8-25.4l0-88.7c-155.3 18.2-161.5-84.6-172-101.7-21.1-36-70.8-45.2-56-62.3 35.4-18.2 71.4 4.6 113.1 66.3 30.2 44.7 89.1 37.2 119 29.7 6.5-26.9 20.5-50.9 39.7-69.6C248.8 728.2 181.7 630 181.7 513.2c0-56.6 18.7-108.7 55.3-150.7-23.3-69.3 2.2-128.5 5.6-137.3 66.5-6 135.5 47.6 140.9 51.8 37.8-10.2 80.9-15.6 129.1-15.6 48.5 0 91.8 5.6 129.8 15.9 12.9-9.8 77-55.8 138.8-50.2 3.3 8.8 28.2 66.7 6.3 135 37.1 42.1 56 94.6 56 151.4 0 117-67.5 215.3-228.8 243.7 26.9 26.6 43.6 63.4 43.6 104.2l0 128.8c0.9 10.3 0 20.5 17.2 20.5C878.1 942.4 1024 750.9 1024 525.3c0-282.9-229.3-512-512-512C229.1 13.2 0 242.3 0 525.2L0 525.2z" />

or

<svg fill="#000000" width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">

change fill attribute to color you want.

添加.well-known路徑及檔案

如申請SSL憑證時,會遇到如下圖驗證步驟:

網路上遍尋不著教學,後來發現可能是方法太簡單,方法如下:

  1. 在前端程式目錄新增 .well-known 資料夾(與子資料夾,以上圖範例為例的話應該於.well-known底下再建立建立pki-validation資料夾,視應用場景而定),將 .txt, .json 檔案置入
  2. config.yml 新增一行 include: [".well-known"]

markdown List Without Bullets

Add below code to your CSS file:

ul {
    list-style-type: none;
    padding: 0; 
    margin: 0;
}

vscode 更改語言設定

以MacOS為例,在vscode介面同時按下:⇧⌘P 三個鍵後,輸入”Configure Display language”,然後選擇喜歡的語言。

Decentralized ID(DID)

1. 什麼是中心化身份

中心化身份系統的身份數據被中央權威機構所把持,相關的授權、認證行為也都交給中心化機構進行,用戶無法直接控制自己的身份。除此之外,用戶在不同中心化系統中可能擁有不同身份,每到新的系統就要註冊一個新的帳號,例如:在蝦皮、Pchome上,我們會註冊不同的名字,可能用不同的信箱、不同的密碼。為了解決前述問題,各個網站聯合起來推出了聯盟身份,使身份具有可移植性,也發展第三方登錄,例如:使用已註冊的Facebook、Google來登錄。

上述來看,中心化身份主要問題有兩點:一、 用戶並不是真的擁有這個身份,二、不同系統間身份無法互通。

2. 什麼是DID

DID全名為Decentralized identifiers,作為去中心化世界的為匿名性(Pseudo -Anonymity)身份識別,是一種較新的標識符(Identifier)。

每個DID都被私鑰(private key)所保護,擁有私鑰才能證明自己是這個去中心化識別的所有者,在與其他服務相連時,通常會用公鑰加密來建立安全的通訊。

一但使用者和DID進行完綁定,結合Verifiable Credentials (VC)技術加上不同系統設計,使用者可以透過例如QR code的方式,向特定服務證明自己的去中心化身份。DID加上VC,使用者擁有身份自主權(Self-Sovereign identity),也提高資料可攜性(Data Portability),在遇到KYC這種驗證身份的情況,較傳統方式快速,不需要重複繁雜的手續、文件檢查,也有效減少身份詐騙(identity fraud)。  

3. Decentralized Identity(DID)現狀

雖然在區塊鏈領域中熱度遠遠低於Defi、側鏈,他還是有它的價值在,下面有一些關於DID的標準與相關項目:

  1. 標準
    1. W3C的DID標準
    2. DIF(Decentralized Identity Foundation)的DID Auth
  2. 項目
    1. 微軟的MicrosoftDID
    2. 位於Hyperledger的Sovrin
    3. 位於以太坊的uPort
    4. 用於交易的Evernym
    5. 使生物識別的多因素身份認證、移動身份平台Civic
    6. 移動身份平台、保護隱私ShoCard  

4. DID結構

DID 結構

DID

Decentralized Identifier,一種全球性的獨一無二的標識符,不需要任何中心化權威機構,通常使用密碼學的方式建立。

DID是一種由三段字串組成的URI:

  1. scheme identifier
  2. the identifier for the DID method
  3. the DID method-specific identifier

以以太坊常見的DID為例:可能是did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9

method的不同,會影響建構DID method-specific identifier與解析DID Document的方式,上例是以以太坊帳號的壓縮公鑰作為DID method-specific identifier。

DID Method

  • 必須清楚定義如何產生method-specific-id
  • 任何由DID Method產生的DID必須要全球獨一無二
  • 減少因為method name產生的conflict,DID method 的規格應該在DID Specification Registries 註冊
  • DID method規格必須定義好如何產生DID、DID resolver如何產生DID document、DID controller如何更新DID document
  • 目前已註冊正在研發中的DID Method規格
    • 專案使用以太坊基金會旗下uPort團隊的 ethr method

DID document

包含與這個DID有關的資訊,通常是指驗證這個DID的方法(verification methods),例如密碼學的公私鑰,以及與這個DID Subject交互的services。DID document的內容被更新,更新方法依不同的methods而定。

DID Document Properties :

Verification Method properties

範例:

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld"
  ],
  "id": "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9",
  "verificationMethod": [
    {
      "id": "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9#controller",
      "type": "EcdsaSecp256k1RecoveryMethod2020",
      "controller": "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9",
      "blockchainAccountId": "0xb7d0249d66683da475642930eA36C46a12554616@eip155:1"
    },
    {
      "id": "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9#controllerKey",
      "type": "EcdsaSecp256k1VerificationKey2019",
      "controller": "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9",
      "publicKeyHex": "037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9"
    }
  ],
  "authentication": [
    "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9#controller",
    "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9#controllerKey"
  ],
  "assertionMethod": [
    "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9#controller",
    "did:ethr:0x037edc7768938d46e18fa08681bb15967dbec0a8a6be8e4fac3279bbe1d03008c9#controllerKey"
  ]
}

DID subjects

被該DID識別的entity,可以是人、組織、任何東西,甚至可以是一個概念。

DID subject同時也可以是DID controller。

DID controllers

DID subject的控制者,可以是人、組織、某自動化的軟體,有能力依照DID method定義好的方法對DID document做更動,這種能力通常使用一組公私鑰來證明。

DID可以有一或多個controller。

DID Methods

和DID Method不同,是一種針對DID document建立、解析、更新、停用的特殊機制,會因DID method而異。

Verifiable data registries

用來記錄DID與解析DID document所需資訊的任何系統都可以叫做verifiable data registry,包含分散式帳本、去中心化儲存,任何形式可信任的資料庫。

DID resolvers & DID resolution

DID resolver是一種輸入DID後會分析並建構出DID document+額外metadata的元件,這樣的過程被稱作DID resolution,通常是到verifiable data registry來“讀取”需要的資料完成resolution,會依照DID method的差異有不同解析方法。

verification method

在Spec裡面的原文:A set of parameters that can be used together with a process to independently verify a proof,例如可以將公鑰當作verification method,使其他人可以用來驗證關聯的私鑰簽名過的數位簽章(proof)

  • Structure
    "verificationMethod": [{
      "id": ...,
      "type": ...,
      "controller": ...,
      "publicKeyJwk": ...
    }, {
      "id": ...,
      "type": ...,
      "controller": ...,
      "publicKeyMultibase": ...
    }]
    
  • Structure中的 publicKeyJwkpublicKeyMultibase 被稱作 Verification Material
  • type,例如JsonWebKey2020

verification relationship

在Spec裡面的原文:An expression of the relationship between the DID subject and a verification method. Different verification relationships enable the associated verification methods to be used for different purposes. 主要分為以下幾種:

  • Authentication
  • Assertion
  • KeyAgreement
  • Capability Invocation
  • Capability Delegation

DID delegate

DID controller可以授權給別人使用驗證機制(verification method),但代理人沒有controller的允許沒辦法進行添加或更改。

services

通過一或多個service endpoints(網路地址例如HTTP URL)和DID subject或相關實體進行交互的方法,例如:discovery services、agent services、social networking services、file storage services、verifiable credential repository services  

5. 以太坊上的DID與相似項目

ERC 1056 - Ethereum Lightweight Identity

  • 官方提案網址
  • 提案動機:
    • ERC725建立身份所需的費用過高
  • 提案重點:
    • 使用區塊鏈上的資源建立去中心化身份,每個以太坊帳號其實都是一個identity

      → 創建身份免費

      → 支援任何擁有key-pair的錢包

    • 可在離線環境中進行,鏈上鏈下均可簽名
    • 可在不更改 primary identifier 的情況下輪換密鑰
    • 身份可透過更新秘鑰移轉給其他地址
    • 可以將DID委託給第三方進行操作、設置權限,並由第三方支付gas fee
  • 合約:EthereumDIDRegistry

ERC 1484 - Digital Identity Aggregator

  • 官方提案網址
  • 基於之前所有數位身分提案(ERCs/EIPs 7257357801056 等)所衍生出的新型數字聚合協議,也可視為一種整合。
  • 提案動機:
    • 隨著數位身分相關提案越來越多,因為各自重點不同,開發人員與用戶有時需要進行繁瑣重複的作業
    • 過去的提案通常把身份概念跟以太坊其中一塊(如:智能合約、簽名驗證)聯繫起來,這個提案避免這些方法,選擇在以太坊網路與個人身份間添加了一層協議層(protocal layer),該協議曾兼容與整合其他協議標準

其餘性質類似但非DID的提案還有 EIP-137: Ethereum Domain Name Service - SpecificationEIP-4361: Sign-In with Ethereum  

參考資料:

  1. ENS names are Decentralized Identifiers (DIDs)
  2. 一文讀懂去中心化身份(DID):通往Web3的護照
  3. How Does Identity Work Today?
  4. W3C
  5. Alice Attempts to Abuse a Verifiable Credential
  6. DID and VC: Untangling Decentralized Identifiers and Verifiable Credentials for the Web of Trust