npm package: @smartledger/bsv-secure
Description: Security-enhanced fork of BSV 1.5.6 with comprehensive signature validation and private key protection
Author: SmartLedger
Latest version: 1.5.7
Deprecated: This package is outdated. Please use @smartledger/smartledger-sdk instead.

# BSV Secure

[![SmartLedger](https://smartledger.solutions/wp-content/uploads/2023/03/smartledger-logo.png)](https://smartledger.solutions)

A security-enhanced fork of the BSV library (v1.5.6) by SmartLedger, the world's leading blockchain distribution company. This version includes comprehensive security improvements while maintaining full API compatibility.

## Security Enhancements

### 1. ECDSA Signature Protection
- Strict DER encoding enforcement
- Leading bit validation
- Low-S value requirement (BIP 62)
- Signature malleability prevention
- Comprehensive r,s value validation

### 2. EDDSA Signature Validation
- Strict length validation
- Component validation
- Zero value checks
- Enhanced error messages

### 3. Private Key Security
- Comprehensive validation
- Memory wiping of sensitive data
- Secure random key generation
- Type checking for all operations
- Protection against key extraction

### 4. Transaction Security
- Malleability prevention
- BIP 62 compliance
- Enhanced validation checks
- Improved error handling

## Installation

```bash
npm install @secure/bsv
```

## Usage

This is a drop-in replacement for BSV 1.5.6. Simply update your package.json:

```json
{
  "dependencies": {
    "bsv": "@secure/bsv@1.5.7"
  }
}
```

Your existing code will work without any changes, now with added security protections.

## API Documentation

The API remains 100% compatible with BSV 1.5.6. All methods maintain their original signatures and return values. The only changes are additional security validations and checks.

For detailed API documentation, visit [BSV Documentation](https://github.com/moneybutton/bsv/tree/v1.5.6).

## Security Features

### Signature Validation
```javascript
const { Ecdsa, KeyPair } = require('@secure/bsv');

// Signatures are automatically validated for:
// - DER encoding
// - Low-S values
// - Leading bits
// - Malleability
// - Uniqueness
const signature = ecdsa.sign(message);
```

### Private Key Protection
```javascript
const { KeyPair } = require('@secure/bsv');

// Secure key generation with comprehensive validation
const keyPair = KeyPair.fromRandom();

// Memory is automatically wiped after use
keyPair.wipe();
```

## Why Choose BSV Secure?

1. **Enhanced Security**: Comprehensive protection against known vulnerabilities
2. **Zero Migration**: 100% compatible with existing BSV 1.5.6 applications
3. **Professional Support**: Backed by SmartLedger, the leading blockchain solutions provider
4. **Active Maintenance**: Regular security updates and improvements
5. **Enterprise Ready**: Built for production use in critical applications

## About SmartLedger

SmartLedger is the world's leading blockchain distribution company, specializing in enterprise blockchain solutions and consulting. We provide:

- Enterprise blockchain solutions
- Security auditing and improvements
- Blockchain consulting and integration
- Custom development services

Visit [smartledger.solutions](https://smartledger.solutions) to learn more about our services.

## License

MIT

## Support

For enterprise support and consulting, contact SmartLedger:
- Website: [smartledger.solutions](https://smartledger.solutions)
- Email: support@smartledger.solutions

## Contributing

We welcome contributions! Please submit pull requests with:
- Comprehensive test coverage
- Detailed security analysis
- Clear documentation updates

## Security Reporting

For security issues, please email security@smartledger.solutions