• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

starius / btcd / 37412945756
54%
master: 55%

Build:
Build:
LAST BUILD BRANCH: bump-deps
DEFAULT BRANCH: master
Ran 06 Oct 2026 04:18AM UTC
Jobs 9
Files 366
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Oct 2026 04:14AM UTC coverage: 54.211% (+0.1%) from 54.114%
37412945756

push

github

starius
txscript: reject SIGHASH_SINGLE signing without a matching output

When SIGHASH_SINGLE has no output corresponding to the input being
signed, legacy signing uses the constant hash one and segwit v0 signing
commits to no outputs. These signatures can allow funds to be
redirected.

Reject this case in RawTxInSignature and RawTxInWitnessSignature with
ErrInvalidSigHashSingleIndex, including when ANYONECANPAY is set.
Their callers inherit the protection; multisig signing omits refused
signatures through its existing error handling, as SignTxOutput now
documents.

The check masks the hash type with sigHashMask (0x1f) like the sighash
code, where Core masks with 3; the two agree for the standard hash
types. When the matching output is absent, Core also refuses
non-standard types such as 0x07, 0x0b and 0x13. btcd's sighash treats
those like SIGHASH_ALL, committing to every output, so they are still
signed. This divergence is intentional.

Leave sighash calculation unchanged to preserve consensus verification.
Taproot signing already rejects this case.

Add regression coverage for P2PKH, bare multisig, P2SH-P2PKH,
P2SH-multisig, P2WPKH and P2TR across the six standard explicit sighash
types, checking both missing-output rejection and successful signing of
supported combinations. Also cover the raw ECDSA signers with
non-standard hash types: without a matching output, 0x23, 0x43 and 0xc3
are refused, while 0x07, 0x0b and 0x13 are still signed.

Port of Bitcoin Core PR bitcoin/bitcoin#35984:
https://github.com/bitcoin/bitcoin/pull/35984

14 of 14 new or added lines in 1 file covered. (100.0%)

72 existing lines in 3 files now uncovered.

38174 of 70418 relevant lines covered (54.21%)

355767.19 hits per line

Coverage Regressions

Lines Coverage ∆ File
45
69.06
-7.19% btcec/v2/ellswift/ellswift.go
25
90.96
0.05% txscript/sign.go
2
57.22
-0.52% wire/v2/message.go
Jobs
ID Job ID Ran Files Coverage
1 address - 37412945756.1 06 Oct 2026 04:18AM UTC 56
17.24
GitHub Action Run
2 btcec - 37412945756.2 06 Oct 2026 04:18AM UTC 18
78.63
GitHub Action Run
3 btcutil - 37412945756.3 06 Oct 2026 04:19AM UTC 95
23.35
GitHub Action Run
4 txscript - 37412945756.4 06 Oct 2026 04:19AM UTC 78
57.57
GitHub Action Run
5 psbt - 37412945756.5 06 Oct 2026 04:19AM UTC 100
23.32
GitHub Action Run
6 chainhash - 37412945756.6 06 Oct 2026 04:19AM UTC 2
82.21
GitHub Action Run
7 btcd - 37412945756.7 06 Oct 2026 04:18AM UTC 252
43.67
GitHub Action Run
8 wire - 37412945756.8 06 Oct 2026 04:19AM UTC 41
85.87
GitHub Action Run
9 chaincfg - 37412945756.9 06 Oct 2026 04:18AM UTC 43
8.88
GitHub Action Run
Source Files on build 37412945756
  • Tree
  • List 366
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #37412945756
  • 99944777 on github
  • Prev Build on port-35984 (#37355032955)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc