# `gno.land/p/moul/addrset/v1`
A set of blockchain addresses, **backed by a B+ tree** (`gno.land/p/nt/bptree`).
The B+ tree successor to [`p/moul/addrset/v0`](https://github.com/moul/gno-contracts/tree/main/p/moul/addrset/v0)
(AVL-backed). **v1 because the backing data structure — and thus the on-chain
storage layout — changed** (a compatibility change ⇒ new version). A B+ tree
packs many entries per persisted node, so a stored address costs ~0.9 KB vs the
AVL backing's ~2.0 KB, and inserts spend materially less gas — prefer v1 for
persisted realm state.
```go
import "gno.land/p/moul/addrset/v1"
var set addrset.Set // zero value is an empty, usable set
set.Add(addr) // true (newly added)
set.Has(addr) // true
set.Remove(addr) // true (was present)
set.IterateByOffset(0, 10, func(a address) bool { return false })
```
**Differences from v1:** the `Tree()` escape hatch is removed (the backing store
never leaks); and — because the B+ tree mutates in place — do not Add/Remove from
inside an iteration callback, and do not copy a non-zero `Set` by value.
<!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) -->
---
Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
**Dependency graph:**

Provenance: imported — see [https://github.com/moul/gno-contracts/pull/2](https://github.com/moul/gno-contracts/pull/2) for context and metadata.
> ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md).
<!-- END GNOCONTRACTS FOOTER -->
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.