CHIP-2025-01 TXv5: Transaction Version 5

Fiendish & Friends episode is dead on Twitter but still available here on RSS for anyone like me who wants to review it.

1 Like

Regarding relocation of function references. The fact that the Functions CHIP moved away from having function references be integers (0-999) to instead allowing arbitrary byte strings (0 to 7 bytes in size) makes relocation much less likely to be needed. The VM only allows for one thousand functions, but the set of valid function identifiers is massive. This allows for name spacing. So a ZK verifier library (brought in via read-only inputs) could have all its functions prefixed with “zk” (reflected in its internal self references) and that way avoid conflict with function names in contracts using it.

2 Likes

I deployed a Proof of Concept for “external libraries as read-only inputs” on Chipnet:

  • TX that deploys the libraries and the contract:

    • 9d4e2a4c0bc0a958352b397869a1c3ea6c5214a5ab515b9908f68637fe51cd21
  • TX that spends the funds in the contract:

    • dd2896bfcbdab85422ffc388aa6fd6dfe4a8c1c771e25f090c4753cc5b291d8b

The contract uses functions that it imports from the library UTXOs. Since we don’t have read-only inputs on Chipnet the library UTXOs do get consumed. But this illustrates the concept.

More details here: AlbaDsl & albaVm: Haskell based DSL and VM for Bitcoin Cash 2025 contract programming - #34 by albaDsl

4 Likes