Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 1.19 KB

File metadata and controls

23 lines (13 loc) · 1.19 KB

Lightning Swaps

Submarine swaps are common use cases in a blockchain.

In Stacks, the LNSwap protocol provides submarine swaps between Stacks and Bitcoin, including interoperability with on-chain and Lightning Network.

Know your Contract

For more details about this production running protocol in Stacks, please refer to LNSwap's GitHub and the learning guide.

The stxswap_v10.clar contract includes the following functionality.

  • lockStx locks the STX for a swap in the contract
  • claimStx claims the STX locked in a contract
  • refundStx refunds the STX locked in a contract

To add a new contract, use Clarinet.

Test your Contract

  • You can manually test your your contracts in the Clarinet console.
  • You can programmatically test your contracts with unit tests.