Skip to content

Commit

Permalink
readme: pay to anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jan 20, 2025
1 parent f9d7e45 commit b77a1f4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import * as btc from '@scure/btc-signer';
- [P2TR-NS Taproot multisig](#p2tr-ns-taproot-multisig)
- [P2TR-MS Taproot M-of-N multisig](#p2tr-ms-taproot-m-of-n-multisig)
- [P2TR-PK Taproot single P2PK script](#p2tr-pk-taproot-single-p2pk-script)
- [P2A Pay To Anchor](#p2a-pay-to-anchor)
- [Transaction](#transaction)
- [Encode/decode](#encodedecode)
- [Inputs](#inputs)
Expand Down Expand Up @@ -398,6 +399,17 @@ deepStrictEqual(clean(btc.p2tr(undefined, [btc.p2tr_pk(PubKey)])), {
});
```

### P2A (Pay to Anchor)

Ephemeral anchors are supported. [Check out docs](https://bitcoinops.org/en/topics/ephemeral-anchors/).

```ts
const p2aScript = hex.decode('51024e73');
const decoded = btc.OutScript.decode(p2aScript);
deepStrictEqual(decoded, { type: 'p2a', script: p2aScript });
deepStrictEqual(hex.encode(btc.OutScript.encode(decoded)), '51024e73');
```

## Transaction

### Encode/decode
Expand Down

0 comments on commit b77a1f4

Please sign in to comment.