  Self-sovereign identity (SSI) is considered to be a "killer application" of
blockchain. However, there is a lack of systematic architecture designs for
blockchain-based SSI systems to support methodical development. An aspect of
such gap is demonstrated in current solutions, which are considered coarse
grained and may increase data security risks. In this paper, we first identify
the lifecycles of three major SSI objects (i.e., key, identifier, and
credential) and present fine-grained design patterns critical for application
development. These patterns are associated with particular state transitions,
providing a systematic view of system interactions and serving as a guidance
for effective use of these patterns. Further, we present an SSI platform
architecture, which advocates the notion of Design-Pattern-as-a-Service. Each
design pattern serves as an API by wrapping the respective pattern code to ease
application development and improve scalability and security. We implement a
prototype and evaluate it on feasibility and scalability.
