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

[BUG] - cardano-cli transaction assemble - not possible to assemble Tx with no signatures #3835

Closed
Tracked by #4301 ...
mkoura opened this issue May 3, 2022 · 4 comments · Fixed by #4408
Closed
Tracked by #4301 ...
Assignees
Labels
bug Something isn't working comp: cardano-cli priority low Issues/RPs that are low priority issues/PRs in relation to a minimum Shelley testnet and Shelley mai type: bug Something is not working user type: internal Created by an IOG employee

Comments

@mkoura
Copy link
Contributor

mkoura commented May 3, 2022

Internal

Area
Other

Summary
It is not possible to sign/witness transaction for txin script where "type": "atLeast", "required": 0 without needing any skey.

$ cardano-cli transaction assemble --tx-body-file test_multisig_no_required_atleast_ci0_zuf_from_tx.body --out-file test_multisig_no_required_atleast_ci0_zuf_from_tx.witnessed
Missing: (--witness-file FILE)

Usage: cardano-cli transaction assemble --tx-body-file FILE
            (--witness-file FILE)
            --out-file FILE

  Assemble a tx body and witness(es) to form a transaction

Script

{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}

See corresponding unit test for ledger - https://github.com/input-output-hk/cardano-ledger/blob/587de4528a8a65bc97bef6a5f91a19283de61580/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Mary/Examples/MultiAssets.hs#L184-L192

Expected behavior
It should be possible to send the script with no signatures for the output.

System info (please complete the following information):

  • OS Name: Fedora 35
  • Node version: 65422ff373f2f88a563afa746a9a16d211ffdc7c
@mkoura mkoura added the bug Something isn't working label May 3, 2022
@CarlosLopezDeLara CarlosLopezDeLara added the priority high issues/PRs that MUST be addressed. The release can't happen without this; label Jun 13, 2022
@CarlosLopezDeLara
Copy link
Contributor

@mkoura Could you clarify for us the use case of this one, please.

cc: @Jimbo4350

@catch-21
Copy link
Contributor

It is the same for timelocking scripts, which may be a more realistic use case. E.g. { "type": "after", "slot": 320800 }
Although, that would probably still be used in combination with some signature witnesses. Even so, this isn't blocking any action, just forcing you to construct a slightly larger transaction than necessary.

@CarlosLopezDeLara CarlosLopezDeLara added priority low Issues/RPs that are low priority issues/PRs in relation to a minimum Shelley testnet and Shelley mai and removed priority high issues/PRs that MUST be addressed. The release can't happen without this; labels Jun 21, 2022
@LudvikGalois LudvikGalois self-assigned this Aug 10, 2022
@Jimbo4350
Copy link
Contributor

Jimbo4350 commented Aug 10, 2022

@LudvikGalois In this case we want --witness-file to also accept SimpleScripts (not plutus scripts because those are specially added to the tx in the build and build-raw commands). We can abuse the readFileScriptInAnyLang function, however we should error if the user tries to include a plutus script.

@CarlosLopezDeLara CarlosLopezDeLara moved this to 📋 Backlog in Node CLI/API 2022 Aug 11, 2022
@CarlosLopezDeLara CarlosLopezDeLara moved this from 📋 Backlog to 🔖 Ready for the next sprint in Node CLI/API 2022 Aug 11, 2022
LudvikGalois pushed a commit that referenced this issue Aug 31, 2022
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses.

Fixes: #3835
LudvikGalois pushed a commit that referenced this issue Aug 31, 2022
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses.

Fixes: #3835
@CarlosLopezDeLara CarlosLopezDeLara moved this from 🔖 Sprint backlog to 👀Code review in Node CLI/API 2022 Aug 31, 2022
LudvikGalois pushed a commit that referenced this issue Sep 13, 2022
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
LudvikGalois pushed a commit that referenced this issue Sep 13, 2022
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
@dorin100 dorin100 added type: bug Something is not working user type: internal Created by an IOG employee comp: cardano-cli labels Oct 21, 2022
LudvikGalois pushed a commit that referenced this issue Dec 28, 2022
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
Jimbo4350 pushed a commit that referenced this issue Jan 5, 2023
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
Jimbo4350 added a commit that referenced this issue Jan 5, 2023
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
Jimbo4350 added a commit that referenced this issue Jan 5, 2023
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
Jimbo4350 added a commit that referenced this issue Jan 5, 2023
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
Jimbo4350 added a commit that referenced this issue Jan 11, 2023
It's possible to write a script which requires no signatures, for
example

```
{
    "scripts": [
        {
            "keyHash": "df243ee05bbe556970c9f8b48088b90549b8c9e41a3380fdede62d16",
            "type": "sig"
        },
        {
            "keyHash": "452c6cc84a5430b4ff720d5692e0ce7f4d37b1f78a3bea99fdbab240",
            "type": "sig"
        },
        {
            "keyHash": "9b925a6b6462e0c7c48fc69a06d1e72d03da30655fd5af40e988140e",
            "type": "sig"
        }
    ],
    "type": "atLeast",
    "required": 0
}
```

As such, it should be supported by the CLI to assemble a transaction
with no witnesses. Both the assemble and sign commands have been updated
to support this.

Fixes: #3835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comp: cardano-cli priority low Issues/RPs that are low priority issues/PRs in relation to a minimum Shelley testnet and Shelley mai type: bug Something is not working user type: internal Created by an IOG employee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@mkoura @LudvikGalois @Jimbo4350 @dorin100 @CarlosLopezDeLara @catch-21 and others