<commit_before># Storj core protocol layer

[Python reference implimentation](https://github.com/storj/storjprotocol)


## Contract version 0 specification

| Property  |      Type             | Description                               |
|-----------|:---------------------:|:-----------------------------------------:|
| version   | integer               | Must be 0                                 |
| renterid  | string                | 160bit base58 encoded                     |
| farmerid  | string                | 160bit base58 encoded                     |
| shardid   | string                | 160bit base58 encoded                     |
| begin     | integer               | Unixtime when the contract begins         |
| duration  | integer               | Contract duration in seconds              |
| end       | integer               | Unixtime when the contract ends           |
| currency  | integer               |                                           |
| amount    | integer               |                                           |
| audits    | [(float, float), ...] | Relative (time, amount), sum must be 1.0  |


## API

### Validate contract

|           |           |
|-----------|-----------|
| Command   | validate  |
| Arguments | contract  |
| Returns   | bool      |
| Raises    |           |
<commit_msg>add description to validate contract function<commit_after># Storj core protocol layer

[Python reference implimentation](https://github.com/storj/storjprotocol)


## Contract version 0 specification

| Property  |      Type             | Description                               |
|-----------|:---------------------:|:-----------------------------------------:|
| version   | integer               | Must be 0                                 |
| renterid  | string                | 160bit base58 encoded                     |
| farmerid  | string                | 160bit base58 encoded                     |
| shardid   | string                | 160bit base58 encoded                     |
| begin     | integer               | Unixtime when the contract begins         |
| duration  | integer               | Contract duration in seconds              |
| end       | integer               | Unixtime when the contract ends           |
| currency  | integer               |                                           |
| amount    | integer               |                                           |
| audits    | [(float, float), ...] | Relative (time, amount), sum must be 1.0  |


## API

### Validate contract

|           |           |                                   |
|-----------|-----------|-----------------------------------|
| Command   | validate  |                                   |
| Arguments | contract  | The contract to be validated.     |
| Returns   | bool      | True if the contract is valid.    |
| Raises    |           |                                   |

{'fraction_non_alphanumeric': 0.15109140518417463, 'fraction_numerical': 0.01296043656207367, 'mean_word_length': 0.8493064312736444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3474804', 'n_tokens_mistral': 662, 'n_tokens_neox': 594, 'n_words': 174}