Documentation
¶
Overview ¶
Package identity provides decentralized identity (DID) derivation from wallet public keys. DIDs are deterministically derived from compressed secp256k1 public keys and mapped to libp2p peer IDs for P2P networking. Private keys never leave the wallet layer.
Index ¶
Constants ¶
View Source
const (
// DIDPrefix is the method-specific prefix for Lango DIDs.
DIDPrefix = "did:lango:"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DID ¶
type DID struct {
ID string `json:"id"` // "did:lango:<hex-compressed-pubkey>"
PublicKey []byte `json:"publicKey"` // compressed secp256k1 public key
PeerID peer.ID `json:"peerId"` // libp2p peer ID derived from pubkey
}
DID represents a decentralized identifier derived from a wallet public key.
func DIDFromPublicKey ¶
DIDFromPublicKey creates a DID from a compressed secp256k1 public key.
type Provider ¶
type Provider interface {
// DID returns the DID for the current wallet.
DID(ctx context.Context) (*DID, error)
// VerifyDID checks that a DID matches the claimed peer ID.
VerifyDID(did *DID, peerID peer.ID) error
}
Provider creates and verifies DIDs.
type WalletDIDProvider ¶
type WalletDIDProvider struct {
// contains filtered or unexported fields
}
WalletDIDProvider derives DIDs from a wallet's public key.
func NewProvider ¶
func NewProvider(w wallet.WalletProvider, logger *zap.SugaredLogger) *WalletDIDProvider
NewProvider creates a new WalletDIDProvider.
Click to show internal directories.
Click to hide internal directories.