# Bitcoin Fragment Address

There are 3 ways which the sweep script can be redeemed:

1. 3 of 5 Signature + SweepHash
2. 3 of 5 Signature + Refund Signature
3. 3 of 5 Signature after timeout

This address will be used for both Sweep and Refund Tx. Before the address can receive a sweep, it must sign a refund tx with a timeout.

```markup
# multisig check
<cltv_expiry> OP_CHECKTIMELOCKVERIFY OP_DROP 
3 <Public Key A> <Public Key B> <Public Key C> <Public Key D> <Public Key E> 5 
CHECKMULTISIGVERIFY

# Sweep preimage check 
OP_SIZE 32 OP_EQUALVERIFY OP_HASH160 <RIPEMD160(sweep_hash)> OP_EQUAL

OP_IFDUP 

OP_NOTIF
# Refund signature check 
<judge_pubkey> OP_CHECKSIG
		
		OP_NOTIF
		# timelock check
		'DelayPeriod' OP_CHECKSEQUENCEVERIFY OP_DROP
		OP_ENDIF

OP_ENDIF
```

Judge Pub key in the OP\_NOTIF is different than the active fragment judge for the sweep.

#### Scenario 1

SweepTx Redeem Script

```markup
<sweep_preimage_true> 0 <sig1> <sig2> <sig3> //<cltv_expiry>
```

#### Scenario 2

RefundTx Redeem Script

```markup
<refund_sig> <sweep_preimage_false> <> 0 //<cltv_expiry>
```

#### Scenario 3

Timeout Redeem Script

```markup
<> <0?> <sweep_preimage_false> 0 <sig1> <sig2> <sig3> //<cltv_expiry>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.twilight.org/boomerang/bitcoin-fragment-address.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
