Polkassembly Logo

Head 1
Head 3
Head 4
Create Pencil IconCreate
TRACKS
ORIGINS
Report an issueNeed help with something?
Foot 1
Foot 2
Foot 3
Foot 4
OpenGov
View All Big Tipper
Requested:700 DOT
Rejected

[Retroactive Funding] JAM SDK Implementation of reusable service

inBig Tipper
4 months ago
jam
pvm
polkadot
BeneficiaryBeneficiary:

(700 DOT)

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

1.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.

2.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.

3.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.

4.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.

5.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

1.Assigning roles to participants

Image

2.view main menu

Image

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

Image

4.Select option 2: Participant validation and answering questions

Image

5.Select option 3: Observer validation and viewing answers

Image

6.Select option 4: Verification of user roles and identification vectors

Image

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 and feel free to share questions and comments =)

Note: Thanks Gav and Parity team by this interesting piece of software

Comments (4)

4 months ago

Comments by delegation votes: +Good documentation and easy to understand even for those without deep knowledge of JAM. +Flexible service, easy to update and reusable

4 months ago

Dear Proposer,

Thank you for your proposal. Our first vote on this proposal is AYE.

The Big Tipper track requires 35% participation and simple majority of non-abstain voters according to our voting policy. This proposal has received four aye and zero nay votes from ten members, with three members abstaining. Below is a summary of our members' comments:

In the recent referendum, the majority of voters expressed support, citing the proposal's usefulness and reasonable nature as key factors for their affirmative votes. A few voters chose to abstain, indicating uncertainty about the proposal's value and the need for more information, particularly from those involved in its implementation. Overall, the sentiment leaned towards approval, with several participants eager to see the potential benefits, while others remained cautious and open to further discussion before committing.

The full discussion can be found in our internal voting.

Kind regards,
Permanence DAO

Load more comments
PleaseLogin to comment

Proposal Failed

3

of 3

Summary

0%

Aye

AyeNay

0%

Nay

Aye (20)0.0 DOT

Support0.0 DOT

Nay (23)0.0 DOT

Voting Data

Approval%

Support%

Threshold0.00%

Threshold0.00%

Comments (4)

4 months ago

Comments by delegation votes: +Good documentation and easy to understand even for those without deep knowledge of JAM. +Flexible service, easy to update and reusable

4 months ago

Dear Proposer,

Thank you for your proposal. Our first vote on this proposal is AYE.

The Big Tipper track requires 35% participation and simple majority of non-abstain voters according to our voting policy. This proposal has received four aye and zero nay votes from ten members, with three members abstaining. Below is a summary of our members' comments:

In the recent referendum, the majority of voters expressed support, citing the proposal's usefulness and reasonable nature as key factors for their affirmative votes. A few voters chose to abstain, indicating uncertainty about the proposal's value and the need for more information, particularly from those involved in its implementation. Overall, the sentiment leaned towards approval, with several participants eager to see the potential benefits, while others remained cautious and open to further discussion before committing.

The full discussion can be found in our internal voting.

Kind regards,
Permanence DAO

Load more comments
PleaseLogin to comment

Help Center

Report an Issue
Feedback
Terms and Conditions
Github

Our Services

Docs
Terms of Website
Privacy Policy

A House of Commons Initiative.

Polka Labs Private Limited 2025

All rights reserved.

Terms and ConditionsTerms of Website
Privacy Policy