The VerifiedRegistry actor implements a permissioned registry of "Verified Clients." When making storage deals with Verified Clients, Miners receive a bonus incentive via the StorageMarket actor.
The VerifiedRegistry actor has three primary roles:
RootKey
has the permission to add Verifiers
Verifiers
have the permission to add VerifiedClients
VerifiedClients
make "Verified Deals" with Miners.Actor Type:
Exported Methods:
type State struct {
RootKey addr.Address
Verifiers cid.Cid
VerifiedClients cid.Cid
}
RootKey
: The address that has the permission to add/remove new Verifiers
RootKey
should be the ID address of a Multisig actorVerifiers
: A collection of addresses that have the permission to add VerifiedClients
. Verifiers
have their own data allowance, which is deducted from the data allowance they initialize any VerifiedClients
with.
map[Address]DataCap
VerifiedClients
: A collection of addresses that have data allowances and make Verified Deals with Miners. Data allowance is spent / recovered via the Market actor.
map[Address]DataCap
func (a Actor) Constructor(rt vmr.Runtime, rootKey *addr.Address) *adt.EmptyValue
The VerifiedRegistry constructor initializes the actor's state with a RootKey
.
func (a Actor) AddVerifier(rt vmr.Runtime, params *AddVerifierParams) *adt.EmptyValue
Allows the RootKey
to add a new Verifier
with its own DataCap
.
type AddVerifierParams struct {
Address addr.Address
Allowance DataCap
}
Address
: The address of the new Verifier to add to the registry.
Address != st.RootKey
Address
cannot be a VerifiedClientAllowance
: The total amount of bytes the new Verifier can allocate to the VerifiedClients
it creates.
Allowance >= MinVerifiedDealSize
st.RootKey
params.Allowance < MinVerifiedDealSize
params.Address
resolves to st.RootKey
params.Address
resolves to an existing VerifiedClientfunc (a Actor) RemoveVerifier(rt vmr.Runtime, verifierAddr *addr.Address) *adt.EmptyValue
Allows the RootKey
to remove an existing Verifier.
verifierAddr
: The Verifier to be removed.
st.RootKey
verifierAddr
does not exist in st.Verifiers
func (a Actor) AddVerifiedClient(rt vmr.Runtime, params *AddVerifiedClientParams) *adt.EmptyValue
Allows a Verifier to add a new Verified Client with its own DataCap
. The DataCap
given to the new Verified Client is subtracted from the Verifier's own DataCap
.
type AddVerifiedClientParams struct {
Address addr.Address
Allowance DataCap
}
Address
: The address of the new Verified Client.
Address != st.RootKey
Allowance
: The number of bytes worth of Verified Deals this Verified Client can make.
Allowance >= MinVerifiedDealSize
DataCap
is less than params.Allowance
params.Allowance < MinVerifiedDealSize
params.Address
resolves to st.RootKey
params.Address
resolves to an existing Verifierparams.Address
resolves to an existing VerifiedClientfunc (a Actor) UseBytes(rt vmr.Runtime, params *UseBytesParams) *adt.EmptyValue
Allows the StorageMarket actor to consume bytes from a Verified Client's allowance.
VerifiedDeal
.UseBytes
with the exact number of bytes for which the deal in question is being made.DataCap
allowance.If a Verified Client has less than MinVerifiedDealSize
allowance left after params.DealSize
is removed, the Verified Client is removed from st.VerifiedClients
.
st.VerifiedClients
entry is simply updated.
type UseBytesParams struct {
Address addr.Address
DealSize abi.StoragePower
}
Address
: The Verified Client whose deal was published via the StorageMarket actor
st.VerifiedClients
DealSize
: The amount of data being consumed by the deal in question. This value is subtracted from the Verified Client's DataCap
params.Address
must have at least DealSize
bytes in their DataCap
params.DealSize < MinVerifiedDealSize
params.Address
does not resolve to an existing VerifiedClientparams.Address
resolves to an existing VerifiedClient, but does not have sufficient allowance for params.DealSize
func (a Actor) RestoreBytes(rt vmr.Runtime, params *RestoreBytesParams) *adt.EmptyValue
In the event a Verified Deal times out, the StorageMarket actor will call this method to restore the deal's bytes to the Verified Client in question.
type RestoreBytesParams struct {
Address addr.Address
DealSize abi.StoragePower
}
Address
: The address of the Verified Client whose deal timed out.
Address != st.RootKey
Address
cannot be a VerifierDealSize
: The amount of bytes being restored to the Verified Client's DataCap
MinVerifiedDealSize
params.DealSize < MinVerifiedDealSize
params.Address
resolves to st.RootKey
params.Address
resolves to an existing Verifier