---
title: llarp::PoW
summary: proof of work 

---

# llarp::PoW



proof of work 


`#include <pow.hpp>`

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[~PoW](Classes/structllarp_1_1PoW.md#function-~pow)**() |
| bool | **[IsValid](Classes/structllarp_1_1PoW.md#function-isvalid)**(llarp_time_t now) const |
| bool | **[DecodeKey](Classes/structllarp_1_1PoW.md#function-decodekey)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & k, [llarp_buffer_t](Classes/structllarp__buffer__t.md) * val) |
| bool | **[BEncode](Classes/structllarp_1_1PoW.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const |
| bool | **[operator==](Classes/structllarp_1_1PoW.md#function-operator==)**(const [PoW](Classes/structllarp_1_1PoW.md) & other) const |
| bool | **[operator!=](Classes/structllarp_1_1PoW.md#function-operator!=)**(const [PoW](Classes/structllarp_1_1PoW.md) & other) const |
| std::string | **[ToString](Classes/structllarp_1_1PoW.md#function-tostring)**() const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| constexpr size_t | **[MaxSize](Classes/structllarp_1_1PoW.md#variable-maxsize)**  |
| llarp_time_t | **[timestamp](Classes/structllarp_1_1PoW.md#variable-timestamp)**  |
| llarp_time_t | **[extendedLifetime](Classes/structllarp_1_1PoW.md#variable-extendedlifetime)**  |
| [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md)< 32 > | **[nonce](Classes/structllarp_1_1PoW.md#variable-nonce)**  |
| uint64_t | **[version](Classes/structllarp_1_1PoW.md#variable-version)**  |

## Public Functions Documentation

### function ~PoW

```cpp
~PoW()
```


### function IsValid

```cpp
bool IsValid(
    llarp_time_t now
) const
```


### function DecodeKey

```cpp
bool DecodeKey(
    const llarp_buffer_t & k,
    llarp_buffer_t * val
)
```


### function BEncode

```cpp
bool BEncode(
    llarp_buffer_t * buf
) const
```


### function operator==

```cpp
inline bool operator==(
    const PoW & other
) const
```


### function operator!=

```cpp
inline bool operator!=(
    const PoW & other
) const
```


### function ToString

```cpp
std::string ToString() const
```


## Public Attributes Documentation

### variable MaxSize

```cpp
static constexpr size_t MaxSize = 128;
```


### variable timestamp

```cpp
llarp_time_t timestamp = 0s;
```


### variable extendedLifetime

```cpp
llarp_time_t extendedLifetime = 0s;
```


### variable nonce

```cpp
AlignedBuffer< 32 > nonce;
```


### variable version

```cpp
uint64_t version = llarp::constants::proto_version;
```


-------------------------------

Updated on 2025-03-02 at 05:10:05 +0000