Skip to main content

Headstash Workflow

The Deployment Workflow

To deploy, or verify a deployment of the headstash contracts, an ibc connection between Terp Network & Secret Network will be used:

A. Build Wasm Artifacts

Building the contracts from source code is a great way to verify code stored on-chain, is the exact same, line for line, with the same source code you are using. This allows for verification that the code deployed will function as we can see it should. With the scripts available, you the wasm blobs can be built and checksums generating an authenticity garuntee.

B. Deploy Public Crates

We deploy the wasm artifacts for the public crates first.

C. Deploy Private Crates (Optional)

It is optional to deploy or use existing snip120u or headstash code-ids, however to deploy your own, there are secret.js scripts available for deploying the contract artifacts manually.

E. Create ICA Account

An Ica account is created with a contract call to the ica-owner. An admin is set either explicity, or the message sender will be. Various public configurations for the headstash and snip120u contracts during this step

F. Configure Headstash Parameters

The Headstash User Experience (UX) Workflow:

A. Connect Eligible Wallet

Any Ethereum or Solana address is able to be considered eligible for headstashes. Claimers will choose between the two wallet types to connect, and will automatically generate a prompt specific to if they are eligible.

B. Generate Throwaway Wallet

If an account is eligible, the next prompts ask the account owner to confirm the throwaway wallet to use to claim their headstash, before verifying their ownership.

C. Verify Ownership

Once the throwaway wallet is generated and confirmed, a prompt to generate a signature using either Metamask or Phantom wallet occurs.

D. Register For FeeGrant

Feegrants can be requested only be eligible claimers, and requires providing the signature to an external API, to verify a wallet can request a feegrant. To minimize the chance of leaking the signature to the public, we include ecies encryption via the ecies-wasm package.

E. Claim Headstash

Now, thats left to do is claim a headstash by broadcasting the msg to claim, with the throwaway wallet, while having this tx covered if the feegrant was needed/registered.

F. Privately IBC Transfer tokens back to Terp Network