Table of Contents
Paymaster Protocol is a library designed to provide a standard for achieving sponsored transactions on StarkNet.
A sponsored transaction is a transaction for which the gas fees are not paid by the person executing it but by another person/organism, the payer.
Here, we have designed a PayableAccount contract that can execute call(s) that are already paid. The sponsored transactions are sent to the classic execute endpoint of the payer account contract (classic OZ Account implementation here). The payer forwards the calldata, along with the user's signature, to the executePaid endpoint of the user account contract (PayableAccount implementation).
This endpoint recomputes the transaction hash of the original user transaction and checks it against the provided signature.
The Cairo part of the repo consists of the PayableAccount implementation. The Python part offers a library to generate/sign/invoke sponsored transactions in a easy way.
There are some examples provided in the examples folder.
Paymaster Protocol is a Protostar package, which can be installed by checking out the protostar.toml
file as well as the .gitmodules
file.
Cairo contracts are built using Protostar :
protostar build
Examples in the examples folder can be run as stand-alone Python scripts.
Unit tests are written in Cairo using Protostar :
protostar test
Integration tests are written in Python using Pytest & Nile :
python -m pytest tests/ --disable-pytest-warnings
Reach out to the maintainer at one of the following places:
If you want to say thank you or/and support active development of this protocol:
- Add a GitHub Star to the project.
- Tweet about this repository.
- Write interesting articles about the project on Dev.to, Medium or your personal blog.
First off, thanks for taking the time to contribute! Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
For a full list of all authors and contributors, see the contributors page.
This repository follows good practices of security, but 100% security cannot be assured. This repository is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the MIT license.
See LICENSE for more information.
- OpenZeppelin for the contracts and the tests that are used in this repository.
- Quaireaux for inspiration the open-source side of this repository.
This project follows the all-contributors specification. Contributions of any kind welcome!