Categorygithub.com/Coursant/Core_origin
modulepackage
1.0.0
Repository: https://github.com/coursant/core_origin.git
Documentation: pkg.go.dev

# Functions

BuildDIDType builds bytes type from chain and network.
CalculateChecksum returns the checksum for a given type and genesis_root, where checksum: hash( [type | root_genesis ] ).
CheckChecksum returns a bool indicating if the ID.Checksum is consistent with the rest of the ID data.
CheckGenesisStateID check if the state is genesis for the id.
DecomposeID returns type, genesis and checksum from an ID.
DIDGenesisFromIdenState calculates the genesis ID from an Identity State and returns it as DID.
ElemBytesToInts converts slice of ElemBytes to slice of *big.Int.
FindBlockchainForDIDMethodByValue finds blockchain type by byte value.
FindDIDMethodByValue finds did method by its byte value.
FindNetworkIDForDIDMethodByValue finds network by byte value.
IdenState calculates the Identity State from the Claims Tree Root, Revocation Tree Root and Roots Tree Root.
IDFromBytes returns the ID from a given byte array.
IDFromInt returns the ID from a given big.Int.
IDFromString returns the ID from a given string.
IdGenesisFromIdenState calculates the genesis ID from an Identity State.
NewClaim creates new Claim with specified SchemaHash and any number of options.
NewElemBytesFromInt creates new ElemBytes from *big.Int.
NewID creates a new ID from a type and genesis.
NewSchemaHashFromHex creates new SchemaHash from hex string.
NewSchemaHashFromInt creates new SchemaHash from big.Int.
ParseDID method parse string and extract DID if string is valid Iden3 identifier.
ParseDIDFromID returns did from ID.
ProfileID calculates the Profile ID from the Identity and profile nonce.
WithExpirationDate sets claim's expiration date to `dt`.
WithFlagMerklized sets claim's flag `merklize`.
WithFlagUpdatable sets claim's flag `updatable`.
WithID sets ID to claim's index or value depending on `pos`.
WithIndexData sets data to index slots A & B.
WithIndexDataBytes sets data to index slots A & B.
WithIndexDataInts sets data to index slots A & B.
WithIndexID sets ID to claim's index.
WithIndexMerklizedRoot sets root to index i_2 Returns ErrSlotOverflow if root value are too big.
WithMerklizedRoot sets root to value v_2 or index i_2 Returns ErrSlotOverflow if root value are too big.
WithRevocationNonce sets claim's revocation nonce.
WithValueData sets data to value slots A & B.
WithValueDataBytes sets data to value slots A & B.
WithValueDataInts sets data to value slots A & B.
WithValueID sets ID to claim's value.
WithValueMerklizedRoot sets root to value v_2 Returns ErrSlotOverflow if root value are too big.
WithVersion sets claim's version.

# Constants

DIDMethodIden3 DID method-name.
DIDMethodPolygonID DID method-name.
DIDSchema DID Schema.
Ethereum is ethereum blockchain network.
goerli.
IDPositionIndex means ID value is in index slots.
IDPositionNone means ID value not located in claim.
IDPositionValue means ID value is in value slots.
Main is ethereum main network.
MerklizedRootPositionIndex means root data value is in index slots.
MerklizedRootPositionNone means root data value not located in claim.
MerklizedRootPositionValue means root data value is in value slots.
Mumbai is polygon mumbai test network.
NoChain should be used for readonly identity to build readonly flag.
NoNetwork should be used for readonly identity to build readonly flag.
Polygon is polygon blockchain network.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UnknownChain is used when it's not possible to retrieve blockchain type from identifier.
UnknownNetwork is used when it's not possible to retrieve network from identifier.

# Variables

AuthSchemaHash predefined value of auth schema, used for auth claim during identity creation.
DIDMethodByte did method flag representation.
DIDMethodNetwork is map for did methods and their blockchain networks.
ErrDataOverflow means that given *big.Int value does not fit in Field Q e.g.
ErrDIDMethodNotSupported unsupported did method.
ErrIncorrectIDPosition means that passed position is not one of predefined: IDPositionIndex or IDPositionValue.
ErrIncorrectMerklizedPosition means that passed position is not one of predefined: MerklizedRootPositionIndex or MerklizedRootPositionValue.
ErrInvalidDID invalid did format.
ErrInvalidSubjectPosition returns when subject position flags sets in invalid value.
ErrNetworkNotSupportedForDID unsupported network for did.
ErrNoID returns when ID not found in the Claim.
ErrNoMerklizedRoot returns when Merklized Root is not found in the Claim.
TypeDefault specifies the regular identity - first 2 bytes: `00000000 00000000`.
TypeReadOnly specifies the readonly identity, this type of identity MUST not be published on chain - first 2 bytes: `00000000 00000001`.

# Structs

No description provided by the author
No description provided by the author
DIDNetworkFlag is a structure to represent DID blockchain and network id.
ErrSlotOverflow means some ElemBytes overflows Q Field.

# Type aliases

Blockchain id of the network "eth", "polygon", etc.
DIDMethod represents did methods.
ElemBytes length is 32 bytes.
ID is a byte array with [ type | root_genesis | checksum ] [2 bytes | 27 bytes | 2 bytes ] where the root_genesis are the first 28 bytes from the hash root_genesis.
No description provided by the author
No description provided by the author
NetworkID is method specific network identifier.
Option provides the ability to set different Claim's fields on construction.
SchemaHash is a 16-bytes hash of file's content, that describes claim structure.
No description provided by the author