BTCD PGP Collateralization Flow for Openclaw

A Node.js-based automation suite for managing the full lifecycle of BTC-collateralized loans on the PGP (Elastos) network.

contact-nbwfoundation
v1.0.0
Feb 23, 2026
2
1.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install btcd-skill-beta

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install btcd-skill-beta using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is BTCD PGP Collateralization Flow?

This skill provides a robust framework for developers and users to interact with the BTCD collateralization protocol on the PGP chain. By leveraging Openclaw Skills, users can navigate the complex multi-step process of securing loans against Bitcoin without manual intervention at every stage. It handles everything from order creation to zero-knowledge proof submission, ensuring a seamless experience for those looking to utilize their BTC assets within the PGP ecosystem.

The tool focuses on reliability and state management, making it an essential addition to any developer's toolkit when working with Openclaw Skills. It streamlines the interaction between Bitcoin mainnet and the PGP EVM chain, providing a clear path for collateralizing BTC and receiving BTCD tokens while maintaining a strict historical record of all transactions and state changes.

BTCD PGP Collateralization Flow Use Cases

  • Collateralizing Bitcoin to receive BTCD tokens on the PGP chain.
  • Automating the creation and fulfillment of lending orders on the Elastos network.
  • Securely locking BTC collateral and verifying transactions via ZKP proofs.
  • Managing the full lifecycle of a BTC loan including repayment and asset unlocking.

How BTCD PGP Collateralization Flow Works

  1. Initialize the environment and validate wallet balances for both BTC and EVM (PGA) networks using Openclaw Skills utilities.
  2. Create a lending order through the Issuer contract on the PGP chain defining the amount and duration.
  3. Match and take the order while selecting an optimal arbiter for transaction validation.
  4. Broadcast a BTC transaction to the lock script and monitor the blockchain for at least three network confirmations.
  5. Generate and submit a cryptographic ZKP proof of the BTC deposit to the PGP smart contract.
  6. Claim the minted BTCD tokens to the user's EVM wallet once the proof is validated.

BTCD PGP Collateralization Flow Setup

First, copy the scripts to your local working directory:

cp -r <path-to-skill>/scripts/ ./btcd-flow
cd ./btcd-flow

Configure your environment variables by creating a .env file from the provided template:

cp .env.template.txt .env

Ensure you set your EVM_PRIVATE_KEY (with 0x prefix) and BTC_PRIVATE_KEY (hex format). Finally, install the necessary dependencies for this Openclaw Skills package:

npm install

BTCD PGP Collateralization Flow Data Schema & Taxonomy

The skill uses a local state management system to track progress and prevent duplicate actions across the Openclaw Skills workflow.

File Purpose
state/flow-state.json Current active state of the collateralization process.
state/flow-state-<timestamp>.json Archived historical records of completed flows.
.env Configuration for private keys, amounts, and durations.

Key metadata tracked in the state file includes:

  • orderId: The unique on-chain identifier for the lending order.
  • preImage: The cryptographic secret required for claiming tokens.
  • btcTxId: The transaction hash of the locked BTC collateral.
  • confirmations: The real-time count of Bitcoin network confirmations.

BTCD PGP Collateralization Flow Advanced Features

  • Automated state persistence ensures that interrupted flows can be resumed safely without the risk of double-locking BTC.
  • Intelligent BTC confirmation monitoring that automatically resumes waiting if the script is restarted.
  • Dynamic arbiter selection via subgraph integration to find the most reliable transaction validators.
  • Automated Zero-Knowledge Proof (ZKP) generation and submission for cross-chain collateral verification.
  • Automatic archiving of completed session data to maintain a clean workspace for subsequent Openclaw Skills operations.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*