跳到主要内容

Introduction

KVService is designed to save/read user data in a traceable and decentralized way.

Feature

Free data structure

KVService can store any valid JSON object data.

Verifiable records

KVService use the same design of ProofService's signature chain to ensure:

  • Traceable: all changes are approved by user and cannot be falsified by third parties.
  • Decentralized: The user has the full right to dispose the data.
WIP

KVService will provide API for signature chain export. Anyone can verify each changes, and restore the final data status.

Brief of design

  • Every user has N + 1 namespaces:

  • Query data: public, only need to specify avatar.

  • Write data: A patch followed RFC 7396 standard.

    A glimpse of RFC7396
    // Assume data is:
    {
    "a": {
    "b": [2, 3, 4, "test"]
    },
    "c": "Hello"
    }
    // If this patch is submitted:
    { "a": { "b": null, "new_key": true }, "c": "KVService" }
    // Then data will become:
    {
    "a": {
    "new_key": true
    },
    "c": "KVService"
    }
    // Notice: nedted modification of Array value is not supported.
    // Replace the whole Array with new value instead.

Use case

  • Web3 apps need to save user configurations

    e.g. profile (name, avatar link, bio, etc.), NFT showcase (hide/show, order, etc.) or wallet address priority.

Workflow

Write data

APIs mentioned:

Query data

See GET /v1/kv.

Conventions

  • Each app should use their "package name" as their own namespace, to ensure other apps are not infected by your modification.

    For example, my app is io.mask.web3-profile-plugin,

    Then I should make all my modification under { "io.mask.web3-profile-plugin": .... } key.

  • Theoretically, there is no size limitation for data. FairUse™️, please.

    If you want to store data bigger than string, consider Arweave.