---
tags: bounty
---
# ICRC-1 Compliant Payment Library
## Overview
- Status: Open
- Project Type: Traditional - One worker contributes, and one worker is paid
- Time Commitment: Weeks
- Experience Level: Intermediate
- Size: USD 5'000 (client) + USD 2'500 (canister) in ICP (at time of distribution)
## Description
One of the advantages to deploy a service on a blockchain platform is to be able to receive payments without the usage of a 3rd party service provider. In order to simplify the development of services that want to receive payments, we need libraries that can be integrated into client software and canisters. The base ICRC-1 standard supports the client-orchestrated transfer/notify flow, i.e. the client (payer) transfers the token to service-designated subaccount and notifies the service (payee) about the transfer. This process should abstracted by a library.
### High-level flow diagram
```plantuml
@startuml
actor User as U
participant Frontend as F
participant "Payment client library" as Pl
participant "Service Canister" as S
participant "Ledger Canister" as L
U ->F: buy
F->S: buy / get invoice
S->S: create invoice
S-->F: invoice
F->U: show invoice
U->F: confirm payment
activate Pl
F->Pl: pay invoice
Pl->L: transfer to subaccount
L->Pl: ok
Pl->S: notify
S->L: transfer from\nsubaccount to main
L-->S: ok
S-->Pl: ok
Pl-->F: ok
deactivate Pl
F->U: payment successful
@enduml
```
### Notes
* The diagram shows one possible abstraction for a "Payment client library"
* The client library would utilze `agent-js` to perform (`transfer` and `notify`) calls.
* The abstraction of a "Payment service library" is not illustrated.
* The invoice and its relation to a subaccount will probably need to be standardized at some point. Allowing for different compatible payer and payee implementions. We hope that this implementation will inform a potential standardization.
## Acceptance Criteria
- Must support ICRC-1 token standard
- JavaScript/TypeScript payment client library implementation
- Motoko and/or Rust library to be integrated into canisters
- Unit and E2E tests
- Documentation
- Sample application
## Further Information
If you’re only skilled in one of the programming languages, please apply anyway, we might be able to split the grant among different grantees.
If you want to work on that bounty you should participate in the [Ledger & Tokenization Working Group](https://wiki.internetcomputer.org/wiki/Ledger_%26_Tokenization).
## References
- [Agent-js repository](https://github.com/dfinity/agent-js)
- [ICRC-1 specification](https://github.com/dfinity/ICRC-1)