Skip to content

Commit c74ef4c

Browse files
committed
data-model
1 parent 1a9ffbf commit c74ef4c

File tree

7 files changed

+547
-115
lines changed

7 files changed

+547
-115
lines changed

docs/crypto.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ For more details on cryptographic functions in ErgoScript, see [ErgoScript Crypt
4848

4949
### How Sigma Protocols Work
5050

51-
At their core, Sigma protocols provide a secure way to prove the following properties:
51+
At their core, [Sigma protocols](sigma.md) provide a secure way to prove the following properties:
5252

5353
1. **Proof of Knowledge of Discrete Logarithm**: Prove knowledge of the discrete logarithm of a given public key without revealing the secret key.
5454

docs/dev/data-model/data-model.md

+203-103
Large diffs are not rendered by default.

docs/dev/data-model/dlog.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Discrete Logarithm Proofs in Ergo
2+
3+
## Overview
4+
5+
Discrete logarithm proofs are a fundamental cryptographic primitive in Ergo's signature verification mechanism, based on the computational hardness of the discrete logarithm problem in elliptic curve cryptography.
6+
7+
## Key Characteristics
8+
9+
- **Cryptographic Foundation**: Proofs of knowledge of a discrete logarithm (DLog) verify signature authenticity without revealing the secret key
10+
- **Schnorr Signature Basis**: Ergo uses Schnorr signatures built on discrete logarithm proofs
11+
12+
## Technical Details
13+
14+
- **Proof Structure**: Demonstrate knowledge of secret exponent `w` such that `g^w = x`
15+
- `g`: Generator of an elliptic curve group
16+
- `x`: Public key point
17+
- `w`: Private key
18+
19+
## Related Cryptographic Concepts
20+
21+
- [Sigma Protocols](scs/sigma.md)
22+
- [Threshold Signatures](threshold.md)
23+
- [Ring Signatures](ring.md)
24+
25+
## Implementation in ErgoScript
26+
27+
In ErgoScript, discrete logarithm proofs are implemented using the `proveDlog()` predicate, which returns true if a valid proof of knowledge can be provided.
28+
29+
```scala
30+
// DLog-based signature verification
31+
val pubKey = ... // Public key point
32+
val signature = ... // Signature proof
33+
proveDlog(pubKey)
34+
```
35+
36+
## Practical Examples
37+
38+
- [Schnorr Signature Verification](scs/sigma/verifying.md)
39+
- [Public Key Cryptography](scs/ergoscript/public-keys.md)
40+
41+
## Security Considerations
42+
43+
- Based on discrete logarithm problem hardness
44+
- Efficient and compact signature verification
45+
- Supports multi-signatures and ring signatures
46+
47+
## Advanced Applications
48+
49+
- [Cryptographic Foundations](crypto.md)
50+
- [ZeroJoin Privacy Protocol](uses/mixer.md)
51+
- [Sidechains Interoperability](uses/sidechains/sigma-chains.md)
52+
53+
## References
54+
55+
- [Cryptographic Primitives](crypto.md)
56+
- [ErgoScript Capabilities](scs/ergoscript.md)

docs/dev/data-model/nizk.md

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Non-Interactive Zero-Knowledge Proofs in Ergo
2+
3+
## Overview
4+
5+
Non-Interactive Zero-Knowledge Proofs (NIZKs) are advanced cryptographic techniques that allow one party to prove knowledge of a secret without revealing the secret itself, and without requiring real-time interaction between the prover and verifier.
6+
7+
## Theoretical Foundation
8+
9+
NIZKs in Ergo are primarily implemented through **Sigma Protocols** (Σ-protocols), which provide a powerful and flexible approach to zero-knowledge proofs. These protocols are a cornerstone of Ergo's privacy and cryptographic infrastructure.
10+
11+
### Key Characteristics
12+
13+
- **Non-Interactive**: Proofs can be verified without direct communication
14+
- Unlike traditional interactive zero-knowledge proofs, NIZKs can be verified asynchronously
15+
- Reduces computational overhead and network complexity
16+
17+
- **Zero-Knowledge**: No information about the secret is revealed
18+
- Cryptographically guarantees that only the validity of a statement is proven
19+
- Protects sensitive information while maintaining verifiability
20+
21+
- **Composable**: Can be combined using logical operators like AND, OR, and THRESHOLD
22+
- Enables creation of complex cryptographic conditions
23+
- Supports advanced smart contract logic and privacy-preserving protocols
24+
25+
## Cryptographic Primitives
26+
27+
Ergo supports several fundamental zero-knowledge proof types:
28+
29+
1. **Discrete Logarithm Proofs**
30+
- Prove knowledge of a secret key without revealing it
31+
- Fundamental to [Schnorr signature verification](schnorr.md)
32+
- Implemented using `proveDlog()` predicate in [ErgoScript](ergoscript.md)
33+
34+
2. **Diffie-Hellman Tuple Proofs**
35+
- Prove equality of discrete logarithms across different generators
36+
- Enables privacy-preserving key exchange and contract designs
37+
- Critical for advanced cryptographic protocols
38+
39+
## Implementation Techniques
40+
41+
### Fiat-Shamir Transformation
42+
43+
Ergo makes proofs non-interactive using the Fiat-Shamir transformation, which converts interactive proofs into non-interactive ones by using a cryptographic hash function.
44+
45+
Key steps:
46+
- Transform an interactive proof into a non-interactive version
47+
- Use a cryptographic hash function to generate a challenge
48+
- Eliminates the need for real-time communication between prover and verifier
49+
50+
### Proof Composition
51+
52+
Sigma protocols can be combined to create complex proofs:
53+
54+
```scala
55+
// Example of a threshold signature proof
56+
val thresholdProof = prove {
57+
atLeast(
58+
3, // Minimum number of signatures required
59+
Coll(
60+
PK("pubkey1"),
61+
PK("pubkey2"),
62+
PK("pubkey3"),
63+
PK("pubkey4"),
64+
PK("pubkey5")
65+
)
66+
)
67+
}
68+
```
69+
70+
## Advanced Applications
71+
72+
### Privacy-Preserving Techniques
73+
74+
1. **Ring Signatures**
75+
- Prove one of multiple possible signers without revealing the exact signer
76+
- Enables anonymous transactions
77+
- Detailed in [Ring Signatures](ring.md) documentation
78+
79+
2. **Threshold Signatures**
80+
- Require k-out-of-n participants to sign
81+
- Supports multi-party computational scenarios
82+
- Explored in [Threshold Signatures](threshold.md) documentation
83+
84+
3. **Stealth Addresses**
85+
- Generate one-time addresses for enhanced transaction privacy
86+
- Prevent linking of transactions to a specific public address
87+
- Crucial for maintaining financial privacy
88+
89+
### Mixer Protocols
90+
91+
**ZeroJoin** demonstrates a practical application:
92+
- Uses ring signatures and Diffie-Hellman tuples
93+
- Restores fungibility of digital tokens
94+
- Provides non-interactive, trustless mixing
95+
- Detailed in [Mixer Protocol](mixer.md) documentation
96+
97+
## Security Considerations
98+
99+
- Based on the hardness of the discrete logarithm problem
100+
- Requires careful implementation to prevent potential vulnerabilities
101+
- Extensive test coverage in Ergo's cryptographic implementations
102+
- Relies on well-established cryptographic assumptions
103+
104+
## Related Cryptographic Concepts
105+
106+
- [Discrete Logarithm Proofs](dlog.md)
107+
- [Ring Signatures](ring.md)
108+
- [Threshold Signatures](threshold.md)
109+
- [Sigma Protocols](sigma.md)
110+
111+
## Future Research Directions
112+
113+
- Enhanced privacy protocol implementations
114+
- More efficient zero-knowledge proof constructions
115+
- Cross-chain interoperability using NIZKs
116+
- Integration with advanced cryptographic techniques
117+
118+
## Performance and Scalability
119+
120+
NIZKs in Ergo are designed with performance in mind:
121+
- Constant-time proof verification
122+
- Minimal computational overhead
123+
- Efficient serialization and deserialization
124+
- Support for batch verification techniques
125+
126+
## References
127+
128+
- [Sigma Protocols Overview](sigma.md)
129+
- [Cryptographic Foundations](crypto.md)
130+
- [Zero-Knowledge Proofs in Ergo](zkp.md)
131+
- Academic Papers:
132+
- [Sigma Protocols: A Survey](https://eprint.iacr.org/2021/1022)
133+
- [Non-Interactive Zero-Knowledge Proofs](https://eprint.iacr.org/2016/263)
134+
135+
## Conclusion
136+
137+
Ergo's Non-Interactive Zero-Knowledge Proofs represent a sophisticated approach to cryptographic privacy, enabling complex, secure, and flexible smart contract designs while maintaining user confidentiality. By leveraging advanced cryptographic techniques like Sigma Protocols and the Fiat-Shamir transformation, Ergo provides a robust framework for privacy-preserving computational techniques.

docs/dev/data-model/ring.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Ring Signatures in Ergo
2+
3+
## Overview
4+
5+
Ring signatures are an advanced privacy-preserving cryptographic technique that allows a user to sign a transaction on behalf of a group without revealing which specific group member signed it.
6+
7+
## Key Features
8+
9+
- **Anonymity**: Provides plausible deniability by obscuring the actual signer
10+
- **Privacy**: Prevents tracing the origin of a signature to a specific participant
11+
- **Flexible Composition**: Implemented through Ergo's Sigma protocols
12+
13+
## Use Cases
14+
15+
1. **Anonymous Transactions**: Enabling privacy in blockchain transactions
16+
2. **Decentralized Mixers**:
17+
18+
- [ErgoMixer Privacy Protocol](mixer.md)
19+
- [ZeroJoin Privacy Mechanism](zerojoin.md)
20+
21+
3. **Confidential Voting**: Where the voter's identity must remain secret
22+
23+
## Technical Implementation
24+
25+
In Ergo, ring signatures are implemented using Sigma protocols, allowing for:
26+
27+
- Proving knowledge of one secret from a set of secrets
28+
- Creating cryptographic proofs that obfuscate the true signer
29+
30+
### Example Scenario
31+
32+
```scala
33+
// Simplified conceptual representation
34+
val ringSignature = prove {
35+
atLeastOneOf(
36+
List(
37+
proveDlog(pubKey1),
38+
proveDlog(pubKey2),
39+
proveDlog(pubKey3)
40+
)
41+
)
42+
}
43+
```
44+
45+
## Related Cryptographic Concepts
46+
47+
- [Discrete Logarithm Proofs](dlog.md)
48+
- [Threshold Signatures](threshold.md)
49+
- [Sigma Protocols Overview](sigma.md)
50+
51+
## Privacy Mechanisms
52+
53+
- **ZeroJoin**: A privacy protocol leveraging ring signatures to restore fungibility
54+
- **ErgoMixer**: A non-custodial mixing service using ring signature techniques
55+
56+
## Advanced Applications
57+
58+
- [Cryptographic Foundations in Ergo](crypto.md)
59+
- [Schnorr Signatures and Privacy](schnorr.md)
60+
- [Sidechains and Interoperability](sigma-chains.md)
61+
62+
## Security Considerations
63+
64+
- Computational complexity makes tracing the original signer computationally infeasible
65+
- Relies on the hardness of the discrete logarithm problem
66+
- Provides strong privacy guarantees without compromising blockchain security
67+

docs/dev/data-model/threshold.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Threshold Signatures in Ergo
2+
3+
## Overview
4+
5+
Threshold signatures are a cryptographic mechanism that allows a subset of a group to collectively sign a transaction, providing enhanced security and distributed trust.
6+
7+
## Key Characteristics
8+
9+
- **Distributed Signing**: Requires a minimum number of participants to authorize a transaction
10+
- **Flexible Thresholds**: Can be configured as k-out-of-n signatures (e.g., 3-out-of-5)
11+
- **Multi-Party Computation**: Enables complex collaborative signing scenarios
12+
13+
## Detailed Examples
14+
15+
### 3-out-of-5 Threshold Signature
16+
17+
For a comprehensive example, refer to the dedicated tutorial:
18+
- [3-out-of-5 Threshold Signature](scs/sigma/3-out-of-5.md)
19+
20+
### Practical Use Cases
21+
22+
1. **Corporate Governance**:
23+
- Multi-signature wallets requiring collective approval
24+
- [Microcredit Scenario](scs/microcredit.md)
25+
26+
2. **Cross-Chain Interoperability**:
27+
- [Rosen Bridge Mechanisms](eco/rosen.md)
28+
29+
## Implementation Techniques
30+
31+
Ergo supports threshold signatures through its Sigma protocol framework, allowing:
32+
- Proving knowledge of at least k secrets out of n total secrets
33+
- Creating multi-party computational scenarios with robust security guarantees
34+
35+
## Conceptual Implementation
36+
37+
```scala
38+
val thresholdSignature = prove {
39+
atLeastKOutOfN(
40+
k = 3, // Minimum signatures required
41+
n = 5, // Total possible signers
42+
publicKeys = List(
43+
pubKey1, pubKey2, pubKey3,
44+
pubKey4, pubKey5
45+
)
46+
)
47+
}
48+
```
49+
50+
## Related Cryptographic Concepts
51+
52+
- [Sigma Protocols](scs/sigma.md)
53+
- [Discrete Logarithm Proofs](dlog.md)
54+
- [Ring Signatures](ring.md)
55+
56+
## Technical Advantages
57+
58+
- **Reduced Single Point of Failure**: No single participant can unilaterally control funds
59+
- **Flexible Configuration**: Adaptable to various security requirements
60+
- **Privacy Preservation**: Sigma protocols ensure minimal information leakage
61+
62+
## References
63+
64+
- [Cryptographic Foundations](crypto.md)
65+
- [ErgoScript Capabilities](scs/ergoscript.md)

mkdocs.yml

+18-11
Original file line numberDiff line numberDiff line change
@@ -732,18 +732,25 @@ nav:
732732

733733
- Cryptographic:
734734
- crypto.md
735-
- Sigma Protocols:
736-
- dev/scs/sigma.md
737-
- Schnorr:
738-
- dev/scs/sigma/schnorr.md
739-
- Verifying Schnorr Signatures: dev/scs/sigma/verifying.md
740-
- Diffie:
741-
- dev/scs/sigma/diffie.md
742-
- Ring Signatures:
743-
- 3-out-of-5 Threshold Signature: dev/scs/sigma/3-out-of-5.md
744-
- Distributed Signatures: node/sigs.md
745-
# - Signature Scheme Internals: sig-scheme.md
735+
- Signature Schemes:
736+
- Sigma Protocols:
737+
- dev/scs/sigma.md
738+
- Schnorr:
739+
- dev/scs/sigma/schnorr.md
740+
- Verifying Schnorr Signatures: dev/scs/sigma/verifying.md
741+
- Diffie:
742+
- dev/scs/sigma/diffie.md
743+
- Other Signatures:
744+
- Ring Signatures: dev/data-model/ring.md
745+
- Threshold Signatures:
746+
- dev/data-model/threshold.md
747+
- 3-out-of-5 Threshold Signature: dev/scs/sigma/3-out-of-5.md
748+
- Distributed Signatures: node/sigs.md
749+
- Signature Scheme Internals: sig-scheme.md
750+
- Zero-Knowledge Proofs:
751+
- Non-Interactive ZK: dev/data-model/nizk.md
746752
- ZeroJoin: dev/crypto/zerojoin.md
753+
747754
- Data Structures:
748755
- dev/data-model/data-structures.md
749756
- Merkle Tree:

0 commit comments

Comments
 (0)