iid

package
v0.0.0-...-7a9719f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

README

x/iid

Contents

Abstract

Every digital asset in the Cosmos context should have a universally addressable Interchain Identifier (IID). Interchain Identifiers are a standards-compliant mechanism for uniquely identifying and referring to digital assets within chain namespaces. IIDs also enable (off-chain) assertions to be made about (on-chain) digital assets – for instance, in the form of Verifiable Credentials. Each IID is associated with an IID Document, which contains all the data needed to compose and interact with an asset's properties and services.

Concepts

Structure

x/iid module defines a struct IidDocument to house the contents of the identifier and its linked resources and capabilities.

type IidDocument struct {
	// @context is spec for did document.
	Context []*Context `protobuf:"bytes,1,rep,name=context,proto3" json:"@context,omitempty"`
	
	// id represents the id for the iid document.
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	
	// A IID controller is an entity that is authorized to make changes to a IID document.
	Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"`
	
	// A IID document can express verification methods,
	// such as cryptographic public keys, which can be used
	// to authenticate or authorize interactions with the IID subject or associated parties.
	// https://www.w3.org/TR/did-core/#verification-methods
	VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verificationMethod,proto3" json:"verificationMethod,omitempty"`
	
	// Services are used in IID documents to express ways of communicating
	// with the IID subject or associated entities.
	// https://www.w3.org/TR/did-core/#services
	Service []*Service `protobuf:"bytes,5,rep,name=service,proto3" json:"service,omitempty"`
	
	// NOTE: below this line there are the relationships
	// Authentication represents public key associated with the did document.
	// cfr. https://www.w3.org/TR/did-core/#authentication
	Authentication []string `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"`
	
	// Used to specify how the IID subject is expected to express claims,
	// such as for the purposes of issuing a Verifiable Credential.
	// cfr. https://www.w3.org/TR/did-core/#assertion
	AssertionMethod []string `protobuf:"bytes,7,rep,name=assertionMethod,proto3" json:"assertionMethod,omitempty"`
	
	// used to specify how an entity can generate encryption material
	// in order to transmit confidential information intended for the IID subject.
	// https://www.w3.org/TR/did-core/#key-agreement
	KeyAgreement []string `protobuf:"bytes,8,rep,name=keyAgreement,proto3" json:"keyAgreement,omitempty"`
	
	// Used to specify a verification method that might be used by the IID subject
	// to invoke a cryptographic capability, such as the authorization
	// to update the IID Document.
	// https://www.w3.org/TR/did-core/#capability-invocation
	CapabilityInvocation []string `protobuf:"bytes,9,rep,name=capabilityInvocation,proto3" json:"capabilityInvocation,omitempty"`
	
	// Used to specify a mechanism that might be used by the IID subject
	// to delegate a cryptographic capability to another party.
	// https://www.w3.org/TR/did-core/#capability-delegation
	CapabilityDelegation []string          `protobuf:"bytes,10,rep,name=capabilityDelegation,proto3" json:"capabilityDelegation,omitempty"`
	LinkedResource       []*LinkedResource `protobuf:"bytes,11,rep,name=linkedResource,proto3" json:"linkedResource,omitempty"`
	AccordedRight        []*AccordedRight  `protobuf:"bytes,12,rep,name=accordedRight,proto3" json:"accordedRight,omitempty"`
	LinkedEntity         []*LinkedEntity   `protobuf:"bytes,13,rep,name=linkedEntity,proto3" json:"linkedEntity,omitempty"`
	AlsoKnownAs          string            `protobuf:"bytes,14,opt,name=alsoKnownAs,proto3" json:"alsoKnownAs,omitempty"`
}

DIDs and IIDs

Decentralized Identifiers (DIDs) are the W3C specification for identifying any subject in the physical or digital realm. DIDs implement standardised DID Methods to produce fully-qualified Universal Resource Identifier (URI), as defined by RFC3986.

Interchain Identifiers (IIDs) are a DID Method for identifying on-chain assets – such as NFTs, fungible tokens, namespace records and account wallets.

IidDocument

Properties of an IID are conceptually stored in the format of an IID Document object. Which contains core properties (as defined by W3C DID Core):

  • Identifiers
    • DID Subject
    • DID Controller
    • Also Known As
  • Verification Methods
    • Cryptographic material
  • Verification Relationships
    • Authentication
    • Assertion
    • Key Agreement
    • Capability Invocation
    • Capability Delegation
  • Service

As well as two additonal property sets which are unique to digital assets:

  • Linked Resources
  • Accorded Rights

Property extensions may be added by application developers who need to implement their own DID Method for a specific use-case (although it is anticipated that the IID method should serve most).

IID Registry

The IID Module is a Verifiable Data Registry sytem to CRUD decentralized identifiers and IID documents.

Resolving a given IID using the IID Module services returns the data necessary to produce an IID document in a DID-conformant format, which can be serialized as JSON-LD.

IID Method

The IID Method defines a standard way to:

  • Create an IID
  • Set the properties associated with the IID
  • Read (resolve) an IID Document to produce a conformant JSON-LD representation.
  • Update IID Document properties
  • Deactivate an IID
  • Delete an IID
IID Resolver

The IID resolver is a DID resolver service that takes an IID as input and produces an IID Document as output (which conforms to the W3C DID documents format).

IID Deactivation

If an IID has been deactivated, the IID document metadata includes a property with the boolean value true.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState

func InitGenesis

func InitGenesis(ctx sdk.Context, k keeper.Keeper, gs *types.GenesisState) []abci.ValidatorUpdate

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements the AppModule interface for the capability module.

func NewAppModule

func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, wasmKeeper *wasmkeeper.Keeper) AppModule

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock executes all ABCI BeginBlock logic respective to the capability module.

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion implements AppModule/ConsensusVersion.

func (AppModule) EndBlock

EndBlock executes all ABCI EndBlock logic respective to the capability module. It returns no validator updates.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis returns the capability module's exported genesis state as raw JSON bytes.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(
	ctx sdk.Context,
	cdc codec.JSONCodec,
	gs json.RawMessage,
) []abci.ValidatorUpdate

InitGenesis performs the capability module's genesis initialization It returns no validator updates.

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

nolint LegacyQuerierHandler returns the capability module's Querier.

func (AppModule) Name

func (am AppModule) Name() string

Name returns the capability module's name.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute returns the capability module's query routing key.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants registers the capability module's invariants.

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers a GRPC query service to respond to the module-specific GRPC queries.

func (AppModule) Route

func (am AppModule) Route() sdk.Route

Route returns the capability module's message routing key.

type AppModuleBasic

type AppModuleBasic struct {
	// contains filtered or unexported fields
}

AppModuleBasic implements the AppModuleBasic interface for the capability module.

func NewAppModuleBasic

func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns the capability module's default genesis state.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd returns the capability module's root query command.

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd returns the capability module's root tx command.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the capability module's name.

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino)

nolint

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(
	clientCtx client.Context,
	mux *runtime.ServeMux,
)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

nolint

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router)

RegisterRESTRoutes registers the capability module's REST service handlers.

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(
	cdc codec.JSONCodec,
	config client.TxEncodingConfig,
	bz json.RawMessage,
) error

ValidateGenesis performs genesis state validation for the capability module.

Directories

Path Synopsis
client
cli
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL