Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade sigma to v5.0.12 #2040

Merged
merged 68 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2554d90
ai-plugin: configure ChatGPT plugin integration
aslesarenko May 16, 2023
da968ce
ai-plugin: improve descriptions in openxml.yaml
aslesarenko May 18, 2023
a588171
ai-plugin: initial reduced openapi-ai.yaml
aslesarenko May 18, 2023
b16dd08
ai-plugin: initial balanceForAddress works
aslesarenko May 18, 2023
150b447
ai-plugin: blockchain/box/unspent/byAddress works
aslesarenko May 18, 2023
da7fb23
ai-plugin: blockchain/box/byAddress works
aslesarenko May 18, 2023
4276850
ai-plugin: blockchain/transaction/byAddress
aslesarenko May 19, 2023
929c6d3
ai-plugin: better plugin descriptions
aslesarenko May 19, 2023
55022fa
Merge remote-tracking branch 'origin/master' into ai-plugin
aslesarenko Jun 8, 2023
c42e162
ai-plugin: addressed review comments
aslesarenko Jun 21, 2023
4af0ca0
Merge remote-tracking branch 'origin/v5.0.13' into ai-plugin
aslesarenko Jun 26, 2023
7388dc2
ai-plugin: renamed routes
aslesarenko Jun 26, 2023
ab27597
ai-plugin: renamed routes (2)
aslesarenko Jun 26, 2023
a73d077
nipopowSuffix removed from config
kushti Aug 14, 2023
4443af5
UTXOSetBootstrapped flag added to ModePeerFeature
kushti Aug 14, 2023
b97a796
removing outdated peer filters, BlockSectionsDownloadFilter / Headers…
kushti Aug 14, 2023
984b0e0
Merge branch 'v5.0.14' of github.com:ergoplatform/ergo into i2014
kushti Aug 15, 2023
90d1f4b
scaladoc
kushti Aug 15, 2023
82bac6a
Merge branch 'v5.0.14' of github.com:ergoplatform/ergo into i2014
kushti Aug 15, 2023
b86927b
Added local check to peer connection
jellymlg Aug 15, 2023
c710c96
more scaladoc
kushti Aug 16, 2023
b68538d
more scaladoc
kushti Aug 16, 2023
b55135e
scaladoc
kushti Aug 16, 2023
189c06f
more scaladoc
kushti Aug 16, 2023
eb1a539
Merge pull request #2022 from ergoplatform/i2014
kushti Aug 17, 2023
c7d82c0
extension-improvs: typo fix
aslesarenko Aug 17, 2023
ebce412
Merge pull request #2025 from ergoplatform/extension-improvs
kushti Aug 18, 2023
fd95228
with-sigma-v5.0.10: migrated code
aslesarenko Aug 21, 2023
7457d5e
Merge pull request #2027 from ergoplatform/with-sigma-v5.0.10
kushti Aug 21, 2023
f9a7d26
Merge branch 'v5.0.14' of github.com:ergoplatform/ergo into ai-plugin
kushti Aug 22, 2023
a08f681
Merge pull request #2008 from ergoplatform/ai-plugin
kushti Aug 22, 2023
539aa91
readme update
kushti Aug 22, 2023
d07f4f4
link to modes of op
kushti Aug 22, 2023
d419c3b
more links and fixed in readme
kushti Aug 22, 2023
fc58538
Text fixes to readme
glasgowm148 Aug 22, 2023
931d3a2
small amendment
glasgowm148 Aug 22, 2023
91c24c3
Merge pull request #2028 from ergoplatform/i2023
kushti Aug 22, 2023
f95da3a
Added API specification
jellymlg Aug 24, 2023
ca410ac
Updated and refactored endpoints
jellymlg Aug 24, 2023
2e40dfc
Merge branch 'v5.0.14' of github.com:ergoplatform/ergo into i1964-loc…
kushti Aug 24, 2023
f6a882d
warn instead of err
kushti Aug 24, 2023
c9018f0
Merge pull request #2024 from ergoplatform/i1964-localOnly
kushti Aug 24, 2023
ee27cc6
v5.0.14: version and FAQ fixes
aslesarenko Aug 25, 2023
a057767
Merge pull request #2019 from ergoplatform/v5.0.14
kushti Aug 25, 2023
659fd4d
Seq.empty in ErgoValidationSettingsUpdate.empty
kushti Sep 4, 2023
9d0a6d8
simplified upcoming(), validate mempool txs as in next block, Transac…
kushti Sep 4, 2023
32d7eb1
Merge branch 'v5.0.15' of github.com:ergoplatform/ergo into i2020
kushti Sep 12, 2023
c713aef
TooHighCostError rework
kushti Sep 12, 2023
2e1a8f0
timestamp fix in simplifiedUpcoming(), ScalaDoc
kushti Sep 12, 2023
f11cc3c
simplifiedUpcoming name back
kushti Sep 12, 2023
1f23bd6
#1959 Remove lastActivity from ConnectedPeer
ccellado Sep 12, 2023
c235ecc
Merge branch 'master' of github.com:ergoplatform/ergo into v5.0.15
kushti Sep 18, 2023
125a469
Merge pull request #2035 from ccellado/unite_time_delta_info
kushti Sep 18, 2023
285892d
Fixed IndexedErgoBox API schema
jellymlg Sep 19, 2023
633b684
merging w. 5.0.15
kushti Sep 26, 2023
6febeb2
validateWithCost args simplification
kushti Sep 26, 2023
b88fd96
Merge pull request #2033 from ergoplatform/i2020
kushti Sep 26, 2023
dbe903a
Merge pull request #2036 from ergoplatform/i2032-IndexedErgoBox-schema
kushti Sep 26, 2023
75636c2
Merge branch 'v5.0.15' of github.com:ergoplatform/ergo into v5.0.15
kushti Sep 26, 2023
343d090
with-sigma-v5.0.12: upgrade code
aslesarenko Sep 26, 2023
d1d312a
Merge branch 'v5.0.15' into api-unconfirmed-boxes
jellymlg Sep 26, 2023
34fea49
Fixed conflicts
jellymlg Sep 26, 2023
e9e146e
with-sigma-v5.0.12: updated sigma
aslesarenko Sep 28, 2023
8e42b79
Merge pull request #2029 from ergoplatform/api-unconfirmed-boxes
kushti Oct 2, 2023
d9505c0
Merge branch 'v5.0.15' of github.com:ergoplatform/ergo into v5.0.15
kushti Oct 2, 2023
aa9cb7b
fixing test - remove transactions which become invalid
kushti Oct 2, 2023
dc9c0c5
Merge remote-tracking branch 'origin/v5.0.15' into with-sigma-v5.0.12
aslesarenko Oct 2, 2023
1590842
with-sigma-v5.0.12: updated to v5.0.12
aslesarenko Oct 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ The details of the Ergo emission schedule and monetary supply can be found in th

* Website: https://ergoplatform.org/

* Twitter: https://twitter.com/ergoplatformorg
* ErgoDocs: https://docs.ergoplatform.com

* Wiki: https://github.com/ergoplatform/ergo/wiki
* Twitter: https://twitter.com/Ergo_Platform

* Telegram: https://t.me/ergoplatform

* Ecosystem: https://sigmaverse.io
*
* Github: https://github.com/ergoplatform/ergo

* Documents: https://ergoplatform.org/en/documents/

* Telegram: https://t.me/ergoplatform
* Wiki: https://github.com/ergoplatform/ergo/wiki
118 changes: 73 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,96 @@
# Ergo

This repository contains the reference implementation of the
Ergo Platform protocol, which is an alternative to
the [Bitcoin protocol](https://bitcoin.org/bitcoin.pdf).
Welcome to the official repository for the [Ergo Platform](https://ergoplatform.org/). This repository contains the reference client, also known as the node, for Ergo. Ergo is a cryptocurrency protocol that has been designed to offer a secure environment for peer-to-peer transactions. It supports programmable scarce money (Ergo) and a wide range of financial tools.

Ergo Platform website: [https://ergoplatform.org/](https://ergoplatform.org/)
The reference client is primarily written in Scala. While certain components of the protocol are implemented in other languages (for instance, [sigma-rust](https://github.com/ergoplatform/sigma-rust) is a Rust-based implementation of the ErgoScript cryptocurrency scripting language), the reference client provides the most complete and comprehensive implementation of the Ergo protocol.

## Differences from Bitcoin
## Key Features of Ergo

* Powerful contracts in the multi-stage extended UTXO model (see [ErgoScript whitepaper](https://ergoplatform.org/docs/ErgoScript.pdf))
* Memory-hard Proof-of-Work function [Autolykos2](https://docs.ergoplatform.com/ErgoPow.pdf)
* Support for stateless clients (asymmetric, based on [https://eprint.iacr.org/2016/994](https://eprint.iacr.org/2016/994)),
[NiPoPoWs](https://eprint.iacr.org/2017/963.pdf), hybrid modes
* [Alternative transactional language](https://github.com/ScorexFoundation/sigmastate-interpreter), which is more powerful than Bitcoin Script but also safe against
heavy validation attacks
* Alternative fee model with [mandatory storage-rent component](https://fc18.ifca.ai/bitcoin/papers/bitcoin18-final18.pdf )
Ergo, while sharing some commonalities with Bitcoin as a UTXO Proof-of-Work cryptocurrency, stands out due to its unique design and features. It has been built from the ground up, introducing several innovative elements:

* **ErgoScript**: A powerful contract language in the multi-stage extended UTXO model. More details can be found in the [ErgoScript whitepaper](https://ergoplatform.org/docs/ErgoScript.pdf).
* **Autolykos2**: A memory-hard Proof-of-Work function, providing enhanced security. Learn more about it [here](https://docs.ergoplatform.com/ErgoPow.pdf).
* Support for Stateless Clients: Ergo supports asymmetric stateless clients, based on [this paper](https://eprint.iacr.org/2016/994), and includes features like NiPoPoWs and hybrid modes.
* **Advanced Transactional Language**: Ergo introduces an [alternative transactional language](https://github.com/ScorexFoundation/sigmastate-interpreter) that is more powerful than Bitcoin Script and is designed to be safe against heavy validation attacks.
* **Innovative Fee Model**: Ergo implements an alternative fee model with a [mandatory storage-rent component](https://fc18.ifca.ai/bitcoin/papers/bitcoin18-final18.pdf ) (also known as demurrage).

## Specifications

A [White Paper](https://ergoplatform.org/docs/whitepaper.pdf) with a brief description is available. A Yellow Paper with detailed specification is underway and will be available shortly. At the moment, there are [drafts of the Yellow Paper](https://github.com/ergoplatform/ergo/tree/master/papers/yellow) available,
and currently the reference implementation code should be considered as the specification.
* [white paper](https://ergoplatform.org/docs/whitepaper.pdf) - a brief description of the protocol
* [ErgoScript white paper](https://ergoplatform.org/docs/ErgoScript.pdf) - describes ErgoScript, a Cryptocurrency Scripting Language Supporting Noninteractive Zero-Knowledge Proofs used in Ergo

More papers can be found at [docs.ergoplatform.com/documents](https://docs.ergoplatform.com/documents/).

## Security Assumptions

The Ergo client operates under certain assumptions about its environment:

* The execution environment is trusted. Although the seed is stored in an encrypted file, and the client's wallet attempts to purge the secret key from memory as soon as it is no longer needed, the client does not have defenses against side-channel attacks, memory scans, etc.
* Clocks are expected to be synchronized to a reasonable degree. If a block's timestamp is more than 20 minutes into the future, the block will be temporarily rejected. The client does not utilize NTP or other time synchronization protocols.

## Building and Running the Node and UI

For instructions on how to build and run the node and UI, refer to the [official documentation](https://docs.ergoplatform.com/node/install/).

By default, the node processes all blocks from the genesis block. However, there are other options available that may be more suitable for hardware with limited resources.

* **Bootstrapping with a UTXO set snapshot:** This works similarly to Ethereum's snap-sync. The node first downloads a UTXO set snapshot from a secure point in the past, then downloads blocks following the UTXO set snapshot and applies them to the set. For more details and security proofs, refer to the ["Multi-mode cryptocurrency systems" paper](https://eprint.iacr.org/2018/129.pdf). To enable this feature add the following to your configuration file:
```

ergo {
...
node.utxoBootstrap = true
...
}
```

* The UTXO set snapshot bootstrapping can be further optimized by combining it with NiPoPoW (Non-Interactive Proofs of Proof-of-Work). This method allows for syncing the headers-chain in logarithmic time, as opposed to the linear time required by the standard SPV sync for headers. For more details, refer to the [NiPoPoW paper](https://eprint.iacr.org/2017/963.pdf).
```

ergo{
...
node.nipopow.nipopowBootstrap = true
node.utxo.utxoBootstrap = true
...
}
```

* The stateless mode provides full-node security without the need to hold the entire UTXO set. This is achieved through the methods detailed in the ["Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurrencies" paper](https://eprint.iacr.org/2016/994.pdf). In this mode, it's possible to download and validate an arbitrary-sized suffix of the blockchain. Here's an example of how to configure this mode:

## Security assumptions
```
ergo {
...
node.stateType = "digest"
node.blocksToKeep = 2160 # store and process last three days only
node.nipopow.nipopowBootstrap = true # compatible with NiPoPoWs
...
}
```

This client relies on some assumptions in regards with its environment:

* execution environment is trusted. While seed is stored in encrypted files, and the client's
wallet tries to remove secret key from memory as soon as possible when it is not needed, the
client has no protection from side-channel attacks, memory scans etc.
* clocks should be more or less synchronized. If timestamp of a block is more than 20 minutes
in future, the block will be temporarily rejected. The client does not use NTP or other time
syncing protocols.
For more detailed information on different modes of node operation, please visit [docs.ergoplatform.com/node/modes](https://docs.ergoplatform.com/node/modes).

## Building and Running Node and UI
## Testing Procedures

See [documentation](https://docs.ergoplatform.com/node/install/)
Ergo utilizes three types of tests:

## Testing
1) Unit and property tests: These can be run using the `sbt test` command.
2) Integration tests: These tests require Docker to be installed. Run them with the `sudo sbt it:test` command.
3) Bootstrapping tests: These tests are time-consuming as they verify that the node is syncing with the main network in various regimes. Docker is also required for these tests. Run them with the `sudo sbt it2:test` command.

There are three kinds of tests:
## Setting up the Project in an IDE

1) Unit and property tests, run them with `sbt test` command.
2) Integration tests, they require for Docker to be installed, then run `sudo sbt it:test`.
3) Bootstrapping tests, very slow as they are checking that the node is indeed catching up with the main network in
different regimes, they require for Docker too, run as `sudo sbt it2:test`.
You can use either [IntelliJ IDEA](https://www.jetbrains.com/idea/) (Community or Ultimate edition) or [VSCode](https://code.visualstudio.com/) with the [Metals](https://scalameta.org/metals/) extension.

## Open project in IDE
Ensure that the project can be built with sbt before opening it in an IDE. You may need to resolve any dependency errors first.

Your can use [IntelliJ IDEA](https://www.jetbrains.com/idea/) (Community or Ultimate edition) or
[VSCode](https://code.visualstudio.com/) + [Metals](https://scalameta.org/metals/).
Before opening the project in IDE make sure it can be built with sbt.
You may need to fix dependency resolution errors first.
To open the project in IntelliJ IDEA, select File / Open and navigate to the project folder. This will initiate the Project Import Wizard, which uses the SBT configuration (build.sbt file) to generate the project configuration files for IDEA. You can view the project configuration in the `File / Project Structure...` dialog. If the import is successful, you should be able to compile the project in the IDE.

After that you can open the project folder in Idea (File / Open)
which will run Project Import Wizard. The wizard will use SBT configuration
(build.sbt file) to generate Idea's project configuration files.
You can open `File / Project Structure...` dialog to see project configuration.
If everything is successful you can compile the project in IDE.
## Contributing to Ergo

## Contributions
Ergo is an open-source project and we welcome contributions from developers and testers! Join the discussion on [Ergo Discord](https://discord.gg/kj7s7nb) in the #development channel and check out our [Contributing documentation](https://docs.ergoplatform.com/contribute/).

Ergo is open-source and open movement, always in need for testers and developers! Please feel free
to discuss development in [Ergo Discord](https://discord.gg/kj7s7nb), #development channel.
## Frequently Asked Questions

## FAQ
[Frequently Asked Questions](FAQ.md)
For common queries, please refer to our [Frequently Asked Questions](FAQ.md) page.

2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ val circeVersion = "0.13.0"
val akkaVersion = "2.6.10"
val akkaHttpVersion = "10.2.4"

val sigmaStateVersion = "5.0.8"
val sigmaStateVersion = "5.0.12"

// for testing current sigmastate build (see sigmastate-ergo-it jenkins job)
val effectiveSigmaStateVersion = Option(System.getenv().get("SIGMASTATE_VERSION")).getOrElse(sigmaStateVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.ergoplatform.ErgoLikeTransaction;
import org.ergoplatform.UnsignedErgoLikeTransaction;
import scala.collection.JavaConverters;
import sigmastate.basics.DLogProtocol;
import sigmastate.crypto.DLogProtocol;
import java.util.Map;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.ergoplatform.{Height, MinerPubkey, Outputs, Self}
import sigmastate.Values.{ByteArrayConstant, ErgoTree, IntConstant, LongConstant, SigmaPropValue, Value}
import sigmastate.utxo._
import sigmastate._
import special.collection.Coll
import sigma.Coll

/**
* Container for re-emission related contracts. Contains re-emission contract and pay-to-reemission contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.ergoplatform.wallet.boxes

import java7.compat.Math
import org.ergoplatform.ErgoBoxCandidate
import special.collection.Extensions._
import sigma.Extensions._

import scala.collection.compat.immutable.ArraySeq
import scala.collection.mutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.ergoplatform.wallet.serialization.ErgoWalletSerializer
import org.ergoplatform.{ErgoBox, ErgoBoxAssets, ErgoLikeTransaction}
import scorex.util.serialization.{Reader, Writer}
import scorex.util.{ModifierId, bytesToId, idToBytes}
import special.collection.Extensions._
import sigma.Extensions._

/**
* A box tracked by a wallet that contains Ergo box itself as well as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.ergoplatform.wallet.crypto
import org.bouncycastle.util.BigIntegers
import scorex.crypto.hash.Blake2b256
import scorex.util.encode.Base16
import sigmastate.basics.CryptoConstants
import sigmastate.crypto.CryptoConstants
import sigmastate.serialization.GroupElementSerializer

import scala.annotation.tailrec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.ergoplatform.wallet.interpreter

import org.ergoplatform.ErgoLikeContext.Height
import org.ergoplatform.sdk.wallet.protocol.context.ErgoLikeParameters
import org.ergoplatform.sdk.BlockchainParameters
import org.ergoplatform.wallet.protocol.Constants
import org.ergoplatform.{ErgoBox, ErgoBoxCandidate, ErgoLikeContext, ErgoLikeInterpreter}
import scorex.crypto.authds.ADDigest
import scorex.util.ScorexLogging
import sigmastate.Values.ErgoTree
import sigmastate.interpreter.Interpreter.{ScriptEnv, VerificationResult}
import sigmastate.{AvlTreeData, AvlTreeFlags}
import sigma.Coll

import scala.util.Try

Expand All @@ -18,7 +18,7 @@ import scala.util.Try
*
* @param params - current values of adjustable blockchain settings
*/
class ErgoInterpreter(params: ErgoLikeParameters)
class ErgoInterpreter(params: BlockchainParameters)
extends ErgoLikeInterpreter with ScorexLogging {

/** Override default logging for all Ergo interpreters. */
Expand Down Expand Up @@ -96,11 +96,11 @@ object ErgoInterpreter {
val interpreterInitCost = 10000

/** Creates an interpreter with the given parameters. */
def apply(params: ErgoLikeParameters): ErgoInterpreter =
def apply(params: BlockchainParameters): ErgoInterpreter =
new ErgoInterpreter(params)

/** Create [[AvlTreeData]] with the given digest and all operations enabled. */
def avlTreeFromDigest(digest: ADDigest): AvlTreeData = {
def avlTreeFromDigest(digest: Coll[Byte]): AvlTreeData = {
val flags = AvlTreeFlags(insertAllowed = true, updateAllowed = true, removeAllowed = true)
AvlTreeData(digest, flags, Constants.HashLength)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package org.ergoplatform.wallet.interpreter

import org.ergoplatform._
import org.ergoplatform.sdk.BlockchainParameters
import org.ergoplatform.sdk.utils.ArithUtils.{addExact, multiplyExact}
import org.ergoplatform.sdk.wallet.protocol.context.{ErgoLikeParameters, ErgoLikeStateContext}
import org.ergoplatform.sdk.wallet.protocol.context.BlockchainStateContext
import org.ergoplatform.sdk.wallet.secrets.{ExtendedPublicKey, ExtendedSecretKey, SecretKey}
import org.ergoplatform.validation.{SigmaValidationSettings, ValidationRules}
import org.ergoplatform.wallet.boxes.ErgoBoxAssetExtractor
import scorex.crypto.authds.ADDigest
import scorex.util.encode.Base16
import sigmastate.AvlTreeData
import sigmastate.Values.SigmaBoolean
import sigmastate.basics.SigmaProtocolPrivateInput
import sigmastate.crypto.SigmaProtocolPrivateInput
import sigmastate.interpreter.{ContextExtension, ProverInterpreter}
import special.collection.Coll
import special.sigma.{Header, PreHeader}
import sigma.{Coll, Header, PreHeader}

import java.util
import scala.util.{Failure, Success, Try}
Expand All @@ -39,14 +38,14 @@ import scala.util.{Failure, Success, Try}
* (to not to recompute them)
*/
class ErgoProvingInterpreter(val secretKeys: IndexedSeq[SecretKey],
params: ErgoLikeParameters,
params: BlockchainParameters,
val cachedHdPubKeysOpt: Option[IndexedSeq[ExtendedPublicKey]] = None)
extends ErgoInterpreter(params) with ProverInterpreter {

/**
* Interpreter's secrets, in form of sigma protocols private inputs
*/
val secrets: IndexedSeq[SigmaProtocolPrivateInput[_, _]] = secretKeys.map(_.privateInput)
val secrets: IndexedSeq[SigmaProtocolPrivateInput[_]] = secretKeys.map(_.privateInput)

/**
* Only secrets corresponding to hierarchical deterministic scheme (BIP-32 impl)
Expand Down Expand Up @@ -93,14 +92,14 @@ class ErgoProvingInterpreter(val secretKeys: IndexedSeq[SecretKey],
* @param newParams - updated parameters
* @return modified prover
*/
def withNewParameters(newParams: ErgoLikeParameters): ErgoProvingInterpreter = {
def withNewParameters(newParams: BlockchainParameters): ErgoProvingInterpreter = {
new ErgoProvingInterpreter(this.secretKeys, newParams, this.cachedHdPubKeysOpt)
}

def signInputs(unsignedTx: UnsignedErgoLikeTransaction,
boxesToSpend: IndexedSeq[ErgoBox],
dataBoxes: IndexedSeq[ErgoBox],
stateContext: ErgoLikeStateContext,
stateContext: BlockchainStateContext,
txHints: TransactionHintsBag): Try[(IndexedSeq[Input], Long)] = {
if (unsignedTx.inputs.length != boxesToSpend.length) {
Failure(new Exception("Not enough boxes to spend"))
Expand Down Expand Up @@ -164,7 +163,7 @@ class ErgoProvingInterpreter(val secretKeys: IndexedSeq[SecretKey],
def sign(unsignedTx: UnsignedErgoLikeTransaction,
boxesToSpend: IndexedSeq[ErgoBox],
dataBoxes: IndexedSeq[ErgoBox],
stateContext: ErgoLikeStateContext,
stateContext: BlockchainStateContext,
txHints: TransactionHintsBag = TransactionHintsBag.empty): Try[ErgoLikeTransaction] = {

val signedInputs: Try[(IndexedSeq[Input], Long)] =
Expand All @@ -190,7 +189,7 @@ class ErgoProvingInterpreter(val secretKeys: IndexedSeq[SecretKey],
def generateCommitmentsFor(unsignedTx: UnsignedErgoLikeTransaction,
boxesToSpend: IndexedSeq[ErgoBox],
dataBoxes: IndexedSeq[ErgoBox],
stateContext: ErgoLikeStateContext): Try[TransactionHintsBag] = Try {
stateContext: BlockchainStateContext): Try[TransactionHintsBag] = Try {
val inputCmts = unsignedTx.inputs.zipWithIndex.map { case (unsignedInput, inpIndex) =>

val inputBox = boxesToSpend(inpIndex)
Expand Down Expand Up @@ -230,7 +229,7 @@ class ErgoProvingInterpreter(val secretKeys: IndexedSeq[SecretKey],
def bagForTransaction(tx: ErgoLikeTransaction,
boxesToSpend: IndexedSeq[ErgoBox],
dataBoxes: IndexedSeq[ErgoBox],
stateContext: ErgoLikeStateContext,
stateContext: BlockchainStateContext,
realSecretsToExtract: Seq[SigmaBoolean],
simulatedSecretsToExtract: Seq[SigmaBoolean]): TransactionHintsBag = {
val augmentedInputs = tx.inputs.zipWithIndex.zip(boxesToSpend)
Expand Down Expand Up @@ -262,11 +261,11 @@ class ErgoProvingInterpreter(val secretKeys: IndexedSeq[SecretKey],
object ErgoProvingInterpreter {

def apply(secrets: IndexedSeq[SecretKey],
params: ErgoLikeParameters): ErgoProvingInterpreter =
params: BlockchainParameters): ErgoProvingInterpreter =
new ErgoProvingInterpreter(secrets, params)

def apply(rootSecret: ExtendedSecretKey,
params: ErgoLikeParameters): ErgoProvingInterpreter =
params: BlockchainParameters): ErgoProvingInterpreter =
new ErgoProvingInterpreter(IndexedSeq(rootSecret), params)

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.ergoplatform.wallet.interpreter

import org.ergoplatform.{ErgoLikeTransaction, Input, UnsignedErgoLikeTransaction}
import scorex.util.encode.Base16
import sigmastate.basics.DLogProtocol.DLogProverInput
import sigmastate.crypto.DLogProtocol.DLogProverInput
import sigmastate.interpreter.{ContextExtension, ProverResult}

/**
Expand Down
Loading
Loading