Skip to content

WIP: Enterprise POC + Global role#114

Draft
santy311 wants to merge 3 commits intomainfrom
santhosh/poc-entpr-global
Draft

WIP: Enterprise POC + Global role#114
santy311 wants to merge 3 commits intomainfrom
santhosh/poc-entpr-global

Conversation

@santy311
Copy link
Copy Markdown
Collaborator

@santy311 santy311 commented Nov 14, 2025

This change is to help Swig adopt enterprise flow. The idea is to maintain a separate account for Enterprise which will have 3 elements:

  1. Generic: details of enterprise
  2. Swig editable: details of payment like when the payment expires, what are the allowed permissions
  3. Enterprise editable: details that an enterprise can use it for their reference (optional in impl)

Enterprise Handler Program
There is another program that will be used to maintain the Enterprise Account, the program will be used by the swig entity to update once a payment is complete.
https://github.com/anagrambuild/swig-enterprise

Swig program related Flows
Enterprise Wallet creation
Now when an enterprise wants to create a swig wallet for its user, it will invoke the wrapper function CreateEnterpriseInstruction by passing the EnterpriseAccount in addition. This will create a user swig under the enterprise, with enterprise Account id as the role 0 authority.

Signing
Now, during the signing, the enterprise account is passed which will check if the enterprise is still active and has paid for the usage. If all the enterprise related checks pass, then

Adding new authority
When the user swig wants to add a new authority, the permissions will be limited by the permission that the enterprise support. Instead of storing all the permission in the enterprise account, the permissions are flattened as bitmask. A simple & operation between the new permission and allow list will ensure no unpaid permission will be added to the new authority.

Additionally, this change also supports global roles

@santy311 santy311 marked this pull request as draft November 15, 2025 11:04
@santy311 santy311 changed the title WIP: Enterprise POC WIP: Enterprise POC + Global role Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant