A lightweight protocol for enabling attribution of onchain payments through deterministically generated addresses tied to a primary account.
Receiving payments onchain at scale is a challenge due to the lack of attribution. With a single wallet, it is not possible to link N
incoming payments to their corresponding user unless you do one of the following:
- Control the frontend with offchain authentication for end users to make their payments from.
- Get users to submit their sending address to you ahead of their payment.
Both options offer a subpar UX for your users. Alternatively, you could generate N
receiving accounts for each user but this quickly becomes an operational nightmare for your team.
Forwarding addresses is a system for generating counterfactual addresses that can be assigned to each user and immutably tied to your primary account. Sent payments to a forwarding address can be permissionlessly triggered to always sweep to the linked account.
All contracts are deployed deterministically with the following addresses.
Contract | Address |
---|---|
ForwardingAddressFactory | 0xb15dcf07aE4bA9423c9ee0Aba58773C9fd7ec293 |
Before being able to run any command, you need to create a .env file and set your environment variables. You can follow the example in .env.example.
$ forge install
$ forge build
$ forge test
source .env && forge script script/DeployForwardingAddressFactory.s.sol --rpc-url $ETH_RPC_URL --ledger --verify --broadcast