Hello people, i want to introduce my project “JAM Whitelist Role Authorizer”, an implementation that uses the JAM SDK to provide a role-based and whitelist authorization system. This project is a significant contribution to the Polkadot open source ecosystem and demonstrates the potential of the JAM SDK to develop practical and scalable solutions.
What does this project do?
The JAM Whitelist Role Authorizer allows managing authorized addresses, assigning roles (administrator, participant, observer), and running an interactive game where participants answer questions under supervision. The system ensures that only authorized addresses can perform specific actions, ensuring transparency and security in decentralized environments.
Additionally, the repository’s resources are available in both English🇬🇧 and Spanish 🇪🇸, making it easy to use and understand for a global developers.
Open Source Code: Github
JAM SDK Components Used
- jam-types (Implemented) Description: This crate contains basic types and structures needed for working with services and authorizers in JAM.
Components Used:
Authorizer: Represents the JAM system's authorizer. It contains two main fields:
code_hash: A hash representing the program code.
param: A parameter that can store additional information (e.g., the admin's address). CodeHash: Represents a 32-byte hash used to validate whether a hash belongs to a list of valid hashes.
AuthParam: A parameter used to store additional data related to authorization.
Usage in the Project:
Authorizer is used to manage the validation of authorized addresses.
A CodeHash is dynamically generated based on the admin's name and used to verify the authenticity of operations.
AuthParam is extended with the admin's address to track who performed certain actions.
- jam-pvm-common (Reviewed for Future Implementation) Description: Provides common functionalities for working with the PVM (Parity Virtual Machine).
Current Usage: Not explicitly used in the current code.
Future Suggestion: It could be used to ensure that data generated by the authorizer is compatible with the PVM runtime environment. For example, you could implement specific serialization/deserialization functions to handle data in the format required by the PVM.
- jam-bootstrap-service (Reviewed, Used as Reference) Description: A basic service useful for creating initial configurations (genesis) in JAM.
Usage in the Project: Cloned as a reference to understand how to configure a basic service in JAM.
Future Suggestion: It could be used to define an initial configuration that includes predefined addresses for the admin, participant, and observer.
- jam-null-authorizer (Used as a Starting Point, but Not Present in the Current Code) Description: A basic authorizer that allows testing without authorization restrictions.
Current Usage: Not explicitly used in the current code.
Future Suggestion: It could be used as a starting point to implement more advanced test cases. For example, it could be integrated to test scenarios where no authorization is required.
- jam-pvm-build (Reviewed but Not Publicly Available) Description: A CLI tool that allows building PVM code blobs for services or authorizers.
Current Usage: Not explicitly used in the current code.
Future Suggestion: It could be used to compile the custom authorizer into a deployable PVM blob.
Community Value
This project not only demonstrates how to effectively integrate and use the JAM SDK, but also serves as a practical example for other developers wishing to build similar services. It also:
- Encourages adoption of the JAM SDK by providing a real,easily adaptable use case for other functional services.
- Provides a modular and extensible solution that can adapt to various authorization scenarios in decentralized applications.
- Guidance documentation available in multiple languages.
Execution worlflow
- Assigning roles to participants

- view main menu

- Select option 1: Admin validation and selection of number of questions to ask

-
Select option 2: Participant validation and answering questions

-
Select option 3: Observer validation and viewing answers

-
Select option 4: Verification of user roles and identification vectors

Example of ideas for future implementations
Potential Application in Polkadot Blockchain Academy: This role and authorization system could also be adapted to create a useful scenario in the Polkadot Blockchain Academy. For example, the entrance exam could leverage this resource to be more transparent and fair:
- Administrator: Defines the questions and manages the process.
- Participant: Answers the questions within a limit of operations.
- Observer: Monitors the results and ensures impartiality.
By using a blockchain-based system, it is ensured that the process is immutable, transparent, and verifiable by all involved. This could improve trust in the selection process and make it more inclusive for global candidates.
Connection with video games like DOOM executed in JAM: The system developed is an essential component for managing who can interact with services in JAM. For example:
- Access Restriction: In the case of DOOM or another video game, it is possible to use this authorizer to restrict who can deploy or run the application.
- Role Assignment: We could assign specific roles, such as administrators who can modify game parameters or users who can only play the game.
In the case of DOOM, these components could be used to:
- Validate that the DOOM binary has not been modified.
- Authorize certain users to run the game.
- Store relevant metadata, such as the player address or game state.
Thank you for your attention, I hope this resource, documentation and implementation ideas will be useful for everyone. See you in the decentralized future that is getting closer =)
NOte: Thanks Gav and Parity team by this interesting piece of software