internal MusigContext(ECXOnlyPubKey[] pubKeys, ReadOnlySpan <byte> msg32) { if (pubKeys == null) { throw new ArgumentNullException(nameof(pubKeys)); } if (pubKeys.Length is 0) { throw new ArgumentException(nameof(pubKeys), "There should be at least one pubkey in pubKeys"); } if (!(msg32.Length is 32)) { throw new ArgumentNullException(nameof(msg32), "msg32 should be 32 bytes."); } this.pubKeys = pubKeys; this.aggregatePubKey = ECXOnlyPubKey.MusigAggregate(pubKeys, this); this.ctx = pubKeys[0].ctx; this.msg32 = msg32.ToArray(); }