Skip to content

Commit

Permalink
Add helper function TaprootInternalKey.AsTaprootPubKey
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Aug 30, 2024
1 parent b9a6731 commit cbbb505
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions NBitcoin/TaprootInternalPubKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ public TaprootFullPubKey GetTaprootFullPubKey(uint256? merkleRoot)
{
return TaprootFullPubKey.Create(this, merkleRoot);
}
/// <summary>
/// Cast the type of this key into TaprootPubKey.
/// This is only needed to insert the internal key into the PSBT's HDTaprootKeyPaths
/// </summary>
/// <returns>The internal key casted to TaprootPubKey</returns>
public TaprootPubKey AsTaprootPubKey()
{
return new TaprootPubKey(pubkey);
}
public byte[] ComputeTapTweak(uint256? merkleRoot)
{
Span<byte> bytes = stackalloc byte[32];
Expand Down

0 comments on commit cbbb505

Please sign in to comment.