Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[FR] - Balance existing transaction

Abierto
#867 19 comentarios 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
haskell
Área
blockchain, cli

Línea de trabajo

Comienza revisando el flujo de trabajo existente de cardano-cli transaction build y cómo se gestionan los envelopes de transacción, los redeemers y las claves de firma. Se considera terminado cuando una transacción elaborada externamente se equilibra calculando los costes de los scripts y las comisiones, seleccionando los inputs para las comisiones, añadiendo el cambio y escribiendo el resultado en el disco o en stdout usando datos del nodo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs investigation Stale

Internal (anyone could benefit though)

Area
Transaction building

Describe the feature you'd like

I would like to use the cardano-cli to balance a transaction that was drafted by another application. Assuming we have a transaction already built with body and witnesses (redeemers) by a DApp in a transaction envelope tx.json and some signing key wallet.sk which owns ADA to pay fees:

 cardano-cli transaction balance \
   --socket-path ... \ #
   --testnet-magic 2 \
   --unbalanced-tx tx.json \
   --cardano-signing-key wallet.sk \
   --out-file tx.json

Would connect to the cardano-node as usual to fetch various information (utxo owned by user, protocol parameters, system start and era history) and balance the transaction. That is:

  • (Re-)calculate script costs using redeemers from the tx
  • Estimate fees
  • Find and add input to cover fees
  • Add a change output
  • Write the balanced transaction to disk (or stdout)

Alternative with slightly smaller scope: Take only an input to use for paying fees and change address, very much like transaction build.

Describe alternatives you've considered
Obvious alternative is to do all this in the DApp itself, but balancing a transaction is a generic process and not application-specific. Also, this would tie the transaction creating code very much to the "source" of where UTxO, protocol parameters etc. are fetched from. Having it in the cardano-cli, a dedicated client to the cardano-node, would keep it separated from e.g. an alternative workflow that uses blockfrost.

Additional context / screenshots
We encountered this while designing a command line tool to create certain smart contract transactions in the Hydra protocol. More details here: https://github.com/cardano-scaling/hydra/issues/1574

Lenguaje dominante
Haskell
Estrellas
72
Forks
25
Merge medio
1 d 15 h
PR fusionados (30 d)
10

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de IntersectMBO/cardano-cli

Todos los issues de IntersectMBO/cardano-cli

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.