What Are Projects?
Projects are what bind chips to developers. Put another way, a brand may act as a developer and different products they release would be projects. Projects can follow any format a developer likes; the sample PBTSimple project provided by ERS will create a PBT for every chip added and assign ownership to the developer creating the project. Users in subsequent possession of the chip may claim ownership of the chip through the PBT through the transferToken
function.
Adding Projects
In order to add a project the following information must be provided:
- Project Registrar: The address of the project's registrar. This is the contract that will be used to manage the project's chips. End-users will go here to claim their chips. The registrar must implement the
ProjectRegistrar
interface. ERS scripts will help deploy a project registrar based on thePBTSimpleProjectRegistrar.sol
contract, however, a developer may modify this for a fully custom implementation so long as it implements theIProjectRegistrar
interface. - Name Hash: The hash of the project's name. This is used to ensure that the project name is unique within the developer namespace, and creates the
[project].developer.ers
name for the project. - Service ID: The primary
_serviceId
associated with the project and any chips deployed through the project. - Lock In Period: The amount of time any chip within a project is locked to the primary service associated with that project. After the lock in time end users may modify the associated service.
Once a project has been added you can see the project's information by calling projectEnrollments
on the ChipRegistry
and passing in the ProjectRegistrar
address of the project. Additionally, this opens up the ability for Developers to addChips
to a project which in turn may be claimed by end users.
Note that it is possible to remove a project that has not yet added any chips through ChipRegistry
, however, this is not demonstrated in ers-scripts
.
Example: Creating a Project
For an example of creating a project see Creating A Project section in our scripts documentation.
Adding Chips
Once a project has been successfully created, chips may be added to the project. Adding chips may depend on the project implementation, however, the project will in turn call ChipRegistry
that requires the following:
- Chip ID: The address identifying the chip.
- Chip Owner: The initial owner of the chip.
PBTSimpleProjectRegistrar.sol
sets this to the developer adding the chips. - Name Hash: The hash of the chips name. This could be anything from the name of a specific item, to an edition number to a name hash generated from the
chipId
. This creates the[name].project.developer.ers
node for the chip in ERS. - Manufacturer Validation: A struct containing information about the manufacturer enrollment and certificate associated with the chip.
- Custody Proof: A signature generated by the chip over the
developerRegistrar
address.
Adding chips to a project is an immutable action: once a chip has been enrolled to a given project it cannot be removed or transferred away from that project.