Methods, systems, and apparatus, including computer programs encoded on computer storage media, for decentralized-identifier creation. One of the methods includes: receiving a request for obtaining a decentralized identifier (DID), wherein the request comprises an account identifier; obtaining, in response to receiving the request, a public key of a cryptographic key pair; obtaining the DID based on the public key; and storing a mapping relationship between the account identifier and the obtained DID.