The goal of this ARC is to allow asset transfers without the receiver having to explicitly opt-in first.
This code is not fully tested nor has it been audited. Right now it simply serves as a proof of concept.
OPEN_OPT_IN_PROGRAM - The program for the logic signature that can be used by anyone to opt the signing account into assets (source)
OPEN_OPT_IN_SIGNATURE - The signature of OPEN_OPT_IN_PROGRAM
ADDRESS_OPT_IN_PROGRAM - The program for the logic signature that can be used by one specific account to opt the signing account into assets (source)
ADDRESS_OPT_IN_SIGNATURE - The signature of ADRESS_OPT_IN_PROGRAM for a specific account
VERIFIER_LSIG - An lsig whos sole purpose is to verify a given OPEN_OPT_IN_SIGNATURE or ADDRESS_OPT_IN_SIGNATURE against the authorization address of a given account (source)
DELEGATED_OPTIN_APP - A single app deployed on an Algorand network used for storing signatures, verifying delegated opt-ins, and setting expiration times (source)
DYANMO_DB - A centralized server containing a mapping of addresses to signatures
This is the process for onboarding new users in a wallet (ie. Defly, Pera).
- Wallet generates keypair as per usual
- Wallet prompts user if they want to enable deletgated opt-ins
- If yes, the wallet will sign OPEN_OPT_IN_PROGRAM with the generated sk
- This can be a single click
- Wallet sends address and lsig signature to DYANMO_DB
This is the process for a user adding their OPEN_OPT_IN_SIGNATURE to box strorage of the master contract. This can be done at any time by any account.
- MBR Payment: Payent to DELEGATED_OPTIN_APP to cover cost of storing OPEN_OPT_IN_SIGNATURE in a box
- VERIFIER_LSIG: Any type of transaction from VERIFIER_LSIG
- DELEGATED_OPTIN_APP:
setOpenOptInSignature
- sig - OPEN_OPT_IN_SIGNATURE
- acct - The account for which we are adding the OPEN_OPT_IN_SIGNATURE
- authAddr - The auth address of the aforementioned account
This is the process for initiating a delegated opt in using the OPEN_OPT_IN_PROGRAM.
- Attempt to read signature from box in DELEGATED_OPTIN_APP
- If missing or invalid, attempt to read signature from DynamoDB
- Send transaction group below
- MBR Payment - A payment transaction from the sender to the account opting in that covers the ASA MBR (0.1 ALGO)
- Opt In - A opt-in transaction signed by OPEN_OPT_IN_PROGRAM with OPEN_OPT_IN_SIGNATURE
- DELEGATED_OPTIN_APP:
verify
This is the process for an end user setting an end time for their delegated opt ins. Any opt ins after this time will get rejected.
- DELEGATED_OPTIN_APP:
setOpenOptInEndTime
- timestamp - uint64 timestamp
- Should the first sender be required to put the signature in the box?