4

According to Cardano's ledger spec (page 26), the purpose of witnessing is to make sure that the intended action is authorized by the holder of the signing key, providing replay protection as a consequence. For example, the signature of a transaction and a Plutus script are both witnesses.

Witnesses are used by block producers to validate transactions. After a transaction is validated by a block producer, it will be included in a new block, which is then propagated to the network, and verified by the rest of pools. Obviously, witnesses are required as part of the block validation. However, theoretically, once a transaction is validated and included in a block, is there a strong reason to keep the witnesses in the block? Can witnesses be discarded after being used in transaction validation in order to reduce the size of the blockchain? What does the lifecycle of witnesses look like in Cardano?

2

A witness is the public key of the signer and the signature of the txbody using that public key. That is attached to the submitted transaction. It is not possible to query witnesses from db-sync at the moment, but the raw CBOR of the transaction submitted contains all witnesses included in the transaction.

2
  • Thanks Samuel. If I understand correctly, your answer confirms that witnesses only live inside transaction bodies, but not in blocks. This raises a question of how we can find the source code of a Plutus program, which is considered as a witness. One simple solution I can think of is to build a service that record all transactions on the network, including their witnesses, so a script address could be indexed to a Plutus script easily. I am happy to hear if there is a plan or solution proposed by IOG or the community.
    – Jerry
    Oct 1 '21 at 21:58
  • 1
    Blocks are made up of signed transactions. Signed transactions are the raw transaction body + the witnesses for that transaction. cardano-db-sync does not expose witnesses, but the blockchain does store them. Dec 23 '21 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.