Skip to content

Commit 639ac33

Browse files
authored
docs: Add DAL/BLS attestation documentation and clarify encoding differences (#675)
* docs: Add DAL/BLS attestation documentation and clarify encoding differences - Add comprehensive DAL & BLS attestations guide (docs/dal_bls_attestations.md) - Add glossary explaining magic bytes, operation tags, and request kinds (docs/glossary.md) - Update bakers.md with correct tz4 configuration (attestation only, not attestation_with_dal) - Update start.md to clarify tz4 vs tz1/tz2/tz3 encoding differences - Clarify that attestation_with_dal is ONLY for non-BLS keys (tz1/tz2/tz3) Key technical findings: - BLS keys (tz4) use tag 41 encoding which always decodes to 'attestation' - Non-BLS keys (tz1/tz2/tz3) use tag 23 encoding for DAL (attestation_with_dal) - Both consensus and companion tz4 keys receive identical bytes (tag 41) - DAL content is stripped from tz4 signed bytes, used in weighted aggregation Addresses operator confusion about dual-signature pattern and permission requirements. Resolves ambiguity in issue #671 with verified code analysis. Protocol: Tezos 023 (PsSeouLo) Tested: Octez 23.2, Seoultestnet * docs: Fix companion key permissions - attestation only, no preattestation Companion keys only sign attestations (when DAL content is available), never preattestations or blocks. Updated all configuration examples to show only attestation permission for companion keys. Closes #671
1 parent 342efa4 commit 639ac33

File tree

5 files changed

+401
-59
lines changed

5 files changed

+401
-59
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Explore detailed documentation for various components of Signatory:
3333
- [Authorized Keys](https://signatory.io/docs/authorized_keys)
3434
- [Command-Line Interface (CLI)](https://signatory.io/docs/cli)
3535
- [Bakers](https://signatory.io/docs/bakers)
36+
- [DAL & BLS Attestations](https://signatory.io/docs/dal_bls_attestations)
3637

3738
### Vault Backends
3839
- [Azure KMS](https://signatory.io/docs/azure_kms)
@@ -56,6 +57,7 @@ Explore detailed documentation for various components of Signatory:
5657
- [JWT Authentication](https://signatory.io/docs/jwt)
5758
- [Remote Policy Configuration](https://signatory.io/docs/remote_policy)
5859
- [Signatory Architecture](https://signatory.io/docs/architecture)
60+
- [Glossary](https://signatory.io/docs/glossary)
5961

6062
## Features
6163

docs/bakers.md

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -225,85 +225,83 @@ See the official [Signatory documentation](https://signatory.io/docs/) for AWS/G
225225
226226
## Baking with DAL (Data Availability Layer)
227227
228-
The Data Availability Layer (DAL) enables data publication outside of Layer 1 blocks while maintaining decentralization. DAL participation **earns additional incentives** from the network protocol and **supports the Tezos X roadmap** by providing high-bandwidth data distribution for smart rollups.
228+
The Data Availability Layer (DAL) enables data publication outside of Layer 1 blocks while maintaining decentralization. DAL participation **earns additional incentives** (10% of participation rewards) and **supports the Tezos X roadmap**.
229229
230-
### Why Run a DAL Node?
230+
:::danger Critical: BLS Keys Use Different Encoding
231+
**BLS keys (tz4) use tag 41 encoding for ALL attestations.** Both consensus and companion keys receive identical bytes and decode to `request=attestation` in Signatory logs. **Do NOT configure `attestation_with_dal` for tz4 keys** - it has no effect and will cause confusion.
231232
232-
- **Additional Rewards**: Earn extra incentives for DAL attestations (10% of participation rewards)
233-
- **Network Support**: Help scale Tezos by supporting smart rollup data distribution
234-
- **Tezos X Roadmap**: Contribute to the future of Tezos scaling infrastructure
235-
- **Competitive Advantage**: Stay ahead as DAL becomes increasingly important
233+
**Non-BLS keys (tz1/tz2/tz3) with DAL node:** Use `attestation_with_dal` permission (tag 23). These keys can participate in DAL but typically attest with bitset 0.
236234
237-
### Critical Signatory Configuration
235+
**See [DAL & BLS Attestations guide](dal_bls_attestations.md) for detailed explanation.**
236+
:::
237+
238+
### Quick Setup
238239
239-
If your baker participates in DAL attestations, you **must** add `attestation_with_dal` to your Signatory policy:
240+
**1. Configure Signatory Policy**
240241
241242
```yaml
242243
tezos:
243-
tz1YourBakerAddress:
244+
# Consensus key (tz4)
245+
tz4YourConsensusKey:
244246
log_payloads: true
245247
allow:
246-
block: # Standard block baking
247-
attestation: # Standard attestations
248-
preattestation: # Pre-attestations
249-
attestation_with_dal: # Required for DAL attestations
250-
generic:
251-
- transaction
252-
- reveal
253-
- delegation
254-
- stake
255-
```
256-
257-
:::warning Important
258-
Without `attestation_with_dal` in your Signatory policy, DAL attestation requests will be rejected, and you'll miss those rewards.
259-
:::
248+
block:
249+
attestation: # Tag 41 - all attestations
250+
preattestation: # Tag 40
260251
261-
### Key Requirements
252+
# Companion key (tz4)
253+
tz4YourCompanionKey:
254+
log_payloads: true
255+
allow:
256+
attestation: # Tag 41 - only permission needed
257+
```
262258
263-
**BLS Consensus Keys (tz4)**: A **companion key is mandatory** for DAL attestations. Without it, tz4 bakers cannot produce DAL attestations.
259+
**2. Set Keys**
264260
265261
```bash
266-
# Register companion key for existing delegate
262+
# Set consensus and companion keys for your delegate
263+
octez-client set consensus key for <manager_key> to <consensus_key>
267264
octez-client set companion key for <manager_key> to <companion_key>
268265
```
269266
270-
**Baker Command Requirements:**
271-
272-
For DAL participation, your baker command must include:
273-
- **Consensus key**: Required for all attestation operations
274-
- **Companion key**: Required for DAL attestations (especially for tz4 consensus keys)
275-
- **DAL node endpoint**: `--dal-node` parameter pointing to your DAL node
267+
**3. Start Baker with DAL**
276268
277269
```bash
278-
# Example baker command for DAL participation
279270
octez-baker run with local node ~/.tezos-node \
280271
--liquidity-baking-toggle-vote pass \
281272
--dal-node http://localhost:10732 \
282273
consensus_key companion_key
283274
```
284275
285-
**DAL Operations**:
286-
- **`attestation_with_dal`**: Required for DAL participation
287-
- Standard keys (tz1, tz2, tz3): Single consensus key signature
288-
- BLS keys (tz4): Requires both consensus key AND companion key signatures
289-
- **`dal_entrapment_evidence`**: **DO NOT ALLOW** - Anonymous operation, no signature needed
290-
- **`dal_publish_commitment`**: **DO NOT ALLOW** - Only needed if publishing data to DAL
276+
### Key Requirements
291277
292-
### Setup Overview
278+
- **BLS consensus key (tz4)** - Needs `attestation` and `preattestation` permissions
279+
- **BLS companion key (tz4)** - Needs `attestation` permission only (never signs preattestations)
280+
- **DAL node** - Must be running and synced
281+
- **Baker command** - Must include `--dal-node` flag and both key aliases
293282
294-
1. **Run a DAL node** alongside your Tezos node (see [DAL Node Setup Guide](https://octez.tezos.com/docs/shell/dal_run.html))
295-
2. **Configure your baker** to use the DAL node (`--dal-node` flag)
296-
3. **Update Signatory policy** to allow `attestation_with_dal` operations
283+
### What to Expect
297284
298-
```bash
299-
# Start baker with DAL integration
300-
octez-baker run with local node ~/.tezos-node \
301-
--liquidity-baking-toggle-vote pass \
302-
--dal-node http://127.0.0.1:10732 \
303-
consensus_key companion_key
304-
```
285+
**Consensus key** signs whenever baker has attestation rights (regardless of DAL).
286+
**Companion key** signs only when baker has attestation rights **AND** DAL content is available.
287+
288+
Both keys receive **identical tag 41 bytes** and decode to `request=attestation` in Signatory logs. DAL participation happens through weighted BLS aggregation after signing, not through different operation types.
289+
290+
### Troubleshooting
291+
292+
**"Companion tz4 key never signs"**
293+
- Check DAL node is synced: `curl http://localhost:10732/level`
294+
- Verify baker has `--dal-node` flag
295+
- Confirm `attestation` permission in companion key policy (NOT `attestation_with_dal`)
296+
297+
**"Two tz4 signatures with same magic byte"**
298+
- **This is correct for BLS DAL.** Baker sends identical tag 41 bytes to both keys. Both decode to `attestation`. See [DAL & BLS Attestations](dal_bls_attestations.md)
299+
300+
**"Not earning DAL rewards"**
301+
- Check participation: `octez-client rpc get "/chains/main/blocks/head/context/delegates/YOUR_PKH/participation"`
302+
- Look for `dal_attested_slots` > 0
305303
306-
**Further Reading**: [Tezos DAL Architecture](https://docs.tezos.com/architecture/data-availability-layer) | [DAL Node Setup Guide](https://octez.tezos.com/docs/shell/dal_run.html)
304+
**Further Reading**: [DAL & BLS Attestations Guide](dal_bls_attestations.md) | [DAL Node Setup](https://octez.tezos.com/docs/shell/dal_run.html) | [DAL Architecture](https://docs.tezos.com/architecture/data-availability-layer)
307305
308306
---
309307

0 commit comments

Comments
 (0)