Design Patterns For Blockchain-Based Self-Sovereign Identity - European Conference On Pattern Languages of Programs
Design Patterns For Blockchain-Based Self-Sovereign Identity - European Conference On Pattern Languages of Programs
Self-Sovereign Identity
Yue Liu Qinghua Lu
College of Computer Science and Technology, Data61, CSIRO, Australia
China University of Petroleum (East China), China [email protected]
[email protected]
Identifying Revoked /
entities Blockchain Anchor Verified
Expired
Lifecycle of a DID
Multiple
Resolved Dual Verification Identifier Registry
Registration
Blockchain &
Registered Social Media Revoked
Account Pair
Lost /
Created Stored Deleted
Compromised
Interconnection Enabler of a
State transition State Design pattern
between objects design pattern
devices or cloud, and interact with multiple service providers. C. Related Work
To implement self-sovereign identity, the W3C Community
Group specifies a standard for decentralised identifier (DID) Previous works have characterised and applied design pat-
[12], which contains human-readable information and can terns for smart contract and blockchain applications [13],
be used across different platforms. A DID is a URL that [14]. originChain [15], [16] adopts design patterns for data
refers to an entity for trusted interactions. Each DID bonds management and smart contract design to improve the system
to a DID document (DDO) which describes how to use the adaptability. uBaaS encapsulates design patterns as services
specific DID through some given properties, such as context, to facilitate the development of blockchain-based applications
id, public key, and service endpoint. context expresses the [17]. Bartoletti and Pompianu [18] conduct an empirical
system environment for information exchange between two analysis of smart contracts, in which they collected hundreds
DIDs; id is the DID described by this DDO; publicKey is for of smart contracts and divided them into nine categories:
digital signatures and cryptographic operations; and service token, authorisation, oracle, randomness, poll, time constraint,
denotes service endpoints used for interactions among DIDs. termination, math and fork check. Eberhardt and Tai [19]
A DID and its corresponding DDO do not contain any identity propose five patterns, including challenge response pattern,
data which are stored in personal devices or database owned by off-chain signatures pattern, content-addressable storage pat-
the identity service providers. A credential [2] is a verifiable tern, delegated computation pattern, and low contract footprint
claim, carrying particular identity information attributes that pattern, mainly focusing on the separation of on-chain and
an issuer provides to attest to some specific characteristics of off-chain for data and computation. Zhang et al. [20] share
an entity. Within self-sovereign identity, entities are able to the experience of designing a blockchain-based healthcare
issue digitally-signed credentials about themselves and others platform, to which they apply four object-oriented software
linked to their DIDs, and these credentials can be verified patterns to improve the application scalability. Wohrer and
by anyone else. Blockchain has been widely recognised as a Zdun [21] collect six design patterns to address security issues
viable technology for enabling DID in terms of data integrity of smart contract design.
and privacy. As self-sovereign identity needs no intermediary, There have been significant efforts in both industry and
it aligns with the design nature of blockchain which eliminates academia to address many of the identity management chal-
the need for a centralised authority. lenges using blockchain technology [22], [23]. Many organ-
isations and companies have been developing self-sovereign
TABLE I
PATTERN COLLECTION OVERVIEW
identity platforms using blockchain, including Sovrin (Hy- discussion on the forces leading to the problem difficulty, the
perledger Indy) [24], uPort (Ethereum) [25], and Blockstack solution and its consequences, and some examples of real-
(Namecoin) [26]. Decentralised Identity Foundation5 aims to world known uses of the pattern. Note that the forces are
develop an open ecosystem for decentralised identity, and the identified with the quality attributes which may affect the
Internet Identity Workshop6 seeks to find, investigate, and application, and the solution sometimes proposes a trade-off
solve identity issues. There are also projects designing and to mitigate the dilemma.
developing self-sovereign identity systems [27]–[31].
Compared with the existing works, our study focuses on A. Key Management Patterns
the design patterns of blockchain-based self-sovereign iden- 1) Master & Sub Key Generation:
tity, aiming to facilitate the design and development of self-
sovereign identity applications. Some collected patterns are Summary: Each entity has a master-key for managing sub-
already applied in the related works, for instance, Identifier keys which are used to sign transactions for different identity
Registry, Multiple Registration, and Selective Content Gener- accounts. Fig. 4 is a graphical representation of the pattern.
ation can be found in the above projects and studies. Context: Public key cryptography and digital signatures are
III. PATTERNS FOR B LOCKCHAIN - BASED used to identify accounts and authorise transactions submitted
S ELF -S OVEREIGN I DENTITY to a blockchain.
This section introduces 12 patterns for the design of Problem: Using a single key for all transactions has serious
blockchain-based self-sovereign identity applications. We privacy implication for an identity owner since transactions
present the patterns in three groups: key management, DID can be correlated to expose all the identities an entity holds.
management and credential design. The patterns aim to make Forces: The problem requires balancing the following forces:
better use of three main objects in self-sovereign identity –
• Identifiability. An entity needs to create an identity for
key, DID, and identity credential, by understanding their use
sending transactions in the blockchain network.
in different stages of the lifecycles.
• Re-identification. Each entity can have more than one
Fig. 2 and Table I offer an overview of these patterns, while
identities in the real world. For example, one person is
Fig. 3 gives a glimpse of the relations between the patterns
both a client of a bank and a patient of a hospital. If an
collected in this study. We describe each pattern using the
entity handles all the identities via a single key, its privacy
extended pattern form in [7]. This includes the pattern name,
may be violated as all the transactions on blockchain are
a short summary, the usage context, the problem statement, a
transparent and can be correlated.
5 https://identity.foundation/ • Security. There is no a standard approach to protect or
6 https://internetidentityworkshop.com/ recover users’ secret keys.
DID Management Patterns
Blockchain &
Dual
Resolving Linking Social Media
Resolution
DID other ID Account Pair
Identifier
Allowing multiple Updating DID Credential Design Patterns
Registry
identities ownership
Selective
Multiple Delegate Hashing Blockchain
Content
Registration List Anchor
Generation
Blockchain network
Private key
piece 2
.
.
Original private key
Hot wallet Cold wallet .
Private key
Fig. 5. Hot & Cold Wallet Storage Pattern piece N
can be improved by verifying the account using traditional maintains the mapping of an entity’s on-chain identity
identity issued by some central authority. On the other hand, and social media.
blockchain provides a decentralised infrastructure for self- Known uses:
sovereign identity, where entities are in control over their 21
• Onename Onename is a registrar for Blockstack which
own identities. To ensure the trustworthiness, some identity
is a decentralised naming and storage system. With One-
blockchains (e.g. Hyperledger Indy) are designed as public
name, a user can easily register a blockchain ID and cre-
permissioned blockchains, which are governed by a group of
ate corresponding profile on Blockstack, and completely
participants.
has control of his/her blockchain ID and profile. Users
Problem: In addition to verification by some certain people or can can link their Blockstack profiles with existing online
central authorities, a user can link his/her social media profile social media accounts (Twitter, Facebook, Github, etc),
(e.g. Twitter) to his/her identity registered on blockchain to and also embed their blockchain ID on their social media
improve the trustworthiness of both social media profile and posts.
blockchain-based identity. The problem here is how to bind a 4) Dual Resolution:
social media profile with the corresponding blockchain-based
Summary: To establish interactions, two entities can mutually
identity to ensure mapping.
acquire each other’s DDO to access information necessary
Forces: The problem requires balancing the following forces: for verification (e.g., public key) and communication (e.g.,
• Authoritative source. A 1-to-1 mapping is required be- service endpoints for provided services). Fig. 10 is a graphical
tween a social media account and its corresponding representation of the pattern.
blockchain-based identity. Context: In self-sovereign identity, entities interact with each
19 https://blockstack.org/
other.
20 https://daml.com/ 21 https://www.onename.com/
Off-chain On-chain • Identifier Registry (Section III-B1) Entities resolve each
0x1111… DDO other’s identifiers in Identifier Registry.
owner: 0x1111…
id:did:0x1111… Known uses: The existing self-sovereign identity applications
... do not directly point out this feature as a provided functional-
User .
ity, but the users need to resolve each other’s DID when there
0x1111… .
.
is potential interaction.
5) Delegate List:
Identifier registry Summary: Each identifier maintains a list of delegates that
smart contract 0x2222… DDO
User owner: 0x2222… can help the user recover the identity. Fig. 11 is a graphical
0x2222… id:did:0x2222… representation of the pattern.
...
Off-chain On-chain Off-chain
request
Fig. 10. Dual Resolution Pattern update vote
id:did:0x2...student
User Delegate 2
0x5678… owner: 0x1111… (lost) 0x2234…
newOwner: 0x5678…
Problem: When two or more entities want to establish inter-
delegate: 0x1234…, .
actions (e.g., for business purposes), each entity first needs to 0x2234…, .
determine the target entity’s basic information and ways of …, .
0xn234…
communicating before going further. updateThreshold: m
…
Forces: The problem requires balancing the following forces: vote vote
DDO stored in identifier
• Interoperability. For two parties to interact, the ways of Delegate 1 registry smart contract Delegate n
0x1234… 0xn234…
communication have to be interoperable.
• Independence. The interacting entities should remain in- Fig. 11. Delegate List Pattern
dependent of each other and one should not be able to
pry on the other. Context: Each identity has a key pair to authenticate the trans-
Solution: A DDO contains verification methods (i.e. public actions initiated by the user by means of digital signatures.
keys) and service endpoints (e.g., messaging service details) Problem: A master-key may be compromised/stolen by mali-
which can be utilised by an entity to establish interactions cious hackers. A compromised master-key results in the loss of
with the corresponding DID owner. Before any formal activ- ownership over all sub-keys and corresponding identifiers. The
ity between two entities in a relationship, they should first hacker may utilise the identifiers to further steal the entity’s
mutually resolve each other’s DID and obtain the interaction identity data.
information stored in DDO. Such a process is considered as
Forces: The problem requires balancing the following forces:
“Dual Resolution” and it forms the first step for any entity to
establish an interoperation with its target entity. • Compromised private key. Authentication can be achieved
by using digital signatures. Currently, many blockchain
Consequences: platforms do not provide a sound mechanism to recover
Benefits: compromised keys, thus key theft results in permanent
• Interoperability. The Dual Resolution process allows the loss of control over related identifiers.
interacting entities in a relationship to obtain and check • Non-reusability. A compromised identity can be claimed
each other’s basic information on verification and services of no more use, but its owner has to spent extra time,
provided for interoperability. money, and energy to re-register a new identifier and
• Independence. Each DDO stores necessary interaction rebuild all corresponding relationships.
information only for its corresponding DID, hence, an
entity’s different identities are independent from each Solution: Delegate List relies on a web of trust architecture.
other and cannot be correlated. This requires an identity owner to designate its own set of
Drawbacks: trustees that the owner trusts to assist in identity ownership
update when the owner asks for it. An identifier maintains a
• Privacy. It is possible for an entity to store in DDO extra
list of recovery delegates and an update threshold that can help
information about itself other than what is necessary for
the user recover identity. These delegates can be individuals
communication, such as social media accounts, personal
(such as family members or friends) or organisations (such as
websites. Doing so may increase the trustworthiness of
banks). If key loss happens, the original identity owner needs
the entity as more identity information is shared with oth-
to request for ownership update using a new key pair, and a
ers. However, this also increases the risk of unwillingly
minimum number of the trustees (e.g. 2 out of 3) must sign
revealing the entity’s personal information.
a new identity record transaction respectively. When there are
Related patterns: enough confirmations (i.e. reaching the threshold) of the new
key pair, the ownership of the identifier is updated and thus • Baidu Cloud22 Baidu implemented its SSI solution via
the identity is recovered. A timelock period can be specified Quorum, an Ethereum-based DLT. In each user’s DDO, a
to prevent an attacker who tries to compromise an identity “recovery” attribute defines a list of public keys to recover
owner’s key and immediately change the owner’s identity the on-chain identity.
records, including his/her designated trustees to prevent iden-
tifier ownership recovery. C. Credential Design Patterns