spacebudz / lucid

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
https://lucid.spacebudz.io
MIT License
341 stars 142 forks source link

Atlas - Lucid interoperability issue #180

Closed sourabhxyz closed 1 year ago

sourabhxyz commented 1 year ago

Hi,

I obtain the following unsigned transaction from Atlas:

CBOR (say txRaw)

84a40082825820b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a38801825820b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a388020183a400583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1011a01a3b6f40282005820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec03d8185917e082025917db5917d8010000332332233223232323232323232332232323232323233322232323232323232323232323232323232323232323232323233322232323232323232323232323232332232323232323232323232323232323222323223232232323500a2222533532323232323232323232323500b23232322325335010232135011223500222222222222253353335034504b335035335036506a07f3350383506b02407f0051500f1533533573892011e4d757374206265206265666f72652060426574556e74696c602074696d650007e1500f107e135500c2253353303d33506f3355068500a003009002150041533533573892011747756573736573207570646174652069732077726f6e670007115004107113500f22350022222222222225335333503250493350333350343506902107d335036506707d00515011153353357389211a4d757374206265206166746572206052657665616c54696d65600007c15011107c1533533302a03b500933301f036500833301f03600101115007153353357389201515468652063757272656e7420626574206d757374206265206d6f7265207468616e207468652070726576696f7573206265742062792061746c656173742060627270426574537465706020616d6f756e740006d15007106d15335333553067120012206d301e00c06c15001153353357389201174d7573742066756c6c79207370656e64205363726970740006b15001106b15335333573466e3cd540288888d401088cd400880048c98c81accd5ce24811a4e6f7420504b4820666f72206f7261636c6520616464726573730006b01106b06a150011533533573892013e5265666572656e636520696e707574206d7573742062652066726f6d204f7261636c6520616464726573732028777274205061796d656e742070617274290006a15001106a153353353034120012333573466e20c024d400488004c0254cd4cd4c0d04800494cd4ccd5cd19b8f3500122002500406c06b1350600011505f00221350012200113562606a06b001106a1335738921144775657373206973206e6f7420636c6f73657374000691350082235002222222222222533500413263206f33573892010c4e6f207369676e61746f72790006f221533500110022213263207333573892011b4578706563746564206f6e6c79206f6e65207369676e61746f7279000731355003225335333025037001323233301c0330023355302d120012350012233550640023355303012001235001223355067002337049000800800800a80228020834899ab9c491104f7574206265742069732077726f6e67000681533530190062135001223500122220031353263205f33573892118436f756c64206e6f742066696e64206f776e20696e7075740005f22220031355002222200313550012222533350021505d215335303b00121350012233550620020011505e2153353301d0013500922002215335303c00121350012233550630020011505f1505e153353015003130554988854cd40044008884c165262325335333573466e21400410019018c4cdc082028008a800899b813550022222533350021505e2153353041001210011505f2153353301c0013500822002215335304200121001150601505f0011350012235002222222222222533533355302e12001223500222225335001210061335072006005506d33553031120012350012200100b1326320683357389211b4e6f207265666572656e636520696e7075742070726f766964656400068221533500110022213263206c3357389201214578706563746564206f6e6c79206f6e65207265666572656e636520696e7075740006c3333573466e1cd55cea80424000466442466002006004646464646464646464646464646666ae68cdc39aab9d500c480008cccccccccccc88888888888848cccccccccccc00403403002c02802402001c01801401000c008cd4130134d5d0a80619a8260269aba1500b33504c04e35742a014666aa0a0eb9413cd5d0a804999aa8283ae504f35742a01066a0980aa6ae85401cccd54140159d69aba150063232323333573466e1cd55cea80124000466a0526464646666ae68cdc39aab9d5002480008cd40b8cd4181d69aba150023064357426ae8940088c98c81c0cd5ce03403803709aab9e5001137540026ae854008c8c8c8cccd5cd19b8735573aa0049000119a81819a8303ad35742a00460c86ae84d5d1280111931903819ab9c06807006e135573ca00226ea8004d5d09aba2500223263206c3357380c80d80d426aae7940044dd50009aba1500533504c75c6ae854010ccd541401488004d5d0a801999aa8283ae200135742a00460a86ae84d5d1280111931903419ab9c060068066135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d55cf280089baa00135742a01060886ae84d5d1280411931902d19ab9c05205a0583333573466e1d40252002212200123333573466e1d4029200023212230020033051357426aae7940308c98c8168cd5ce02902d02c02b9999ab9a3370e6aae7540312000233032304d37586ae854030ccd54101d7281f9aba135744a018464c640b066ae70140160158415c584d55cf280089baa001135573aa00226ea80044d55cf280089baa001222335530141200123500122335504b002335530171200123500122335504e002333500123300a4800000488cc02c0080048cc02800520000013300f002001253353002001213500122350012222350082235002222222222222333553023120012235002222253353501822350062232335005233500425335333573466e3c0080041c41c05400c41c081c08cd401081c094cd4ccd5cd19b8f002001071070150031070153350032153350022133500223350022335002233500223303800200120732335002207323303800200122207322233500420732225335333573466e1c01800c1d81d454cd4ccd5cd19b8700500207607513304400400110751075106e153350012106e106e13350670060051005506200a1326320483357389201024c660004823500122350022222222222223333500d25050250502505023335530201200133502422533500221003100150502350012253355335333573466e3cd400888008d40108800818017c4ccd5cd19b873500222001350042200106005f105f1350540031505300d232235001222222222222300e0023200135504e2253350011504222135002225335333573466e3c00801c14c1484d411c0044c01800c4888d400888d400888d401488d4008894ccd4ccd404002c01800854cd400454cd40144ccd403802c00c01c41544ccd403802c00c01c41544ccd403802c00c01c48848cc00400c00848848cc00400c0084888d400888d400c894ccd4ccd402401c01000854cd400c4004413c4138413c48848cc00400c0084888c8c8c8c94ccd4018854ccd4018854ccd402084c011261300349854ccd401c84c01126130034984080407854ccd401c84c011261300349854ccd401884c0112613003498407c54ccd4014840744078407054ccd4014854ccd401c84c015261300449854ccd401884c0152613004498407c407454ccd401884c015261300449854ccd401484c0152613004498407894ccd4014854ccd401c854ccd401c84ccd402c028008004585858407854ccd4018854ccd401884ccd40280240080045858584074407094ccd4010854ccd4018854ccd401884ccd4028024008004585858407454ccd4014854ccd401484ccd40240200080045858584070406c94ccd400c854ccd4014854ccd401484ccd4024020008004585858407054ccd4010854ccd401084ccd402001c008004585858406c406894ccd4008854ccd4010854ccd401084ccd402001c008004585858406c54ccd400c854ccd400c84ccd401c0180080045858584068406448d40048888888801c888ccd54c02848004d403540308d400488ccd54c03448004d4041403c8d400488ccd40048cc0292000001223300b00200123300a00148000004cc01000800488cd54c01c480048d400488cd540f8008ccd40048cd54c02c480048d400488cd54108008d5403400400488ccd5540200380080048cd54c02c480048d400488cd54108008d54030004004ccd55400c024008004444888ccd54c010480054108cd54c01c480048d400488cd540f8008d54024004ccd54c0104800488d4008894cd4ccd54c03048004c8cd404488ccd400c88008008004d40048800448cc004894cd4008413040041248d400488cc028008014018400c4cd411801000d410c004cd54c01c480048d400488c8cd540fc00cc004014c8004d54124894cd40044d5402800c884d4008894cd4cc03000802044888cc0080280104c01800c008c8004d5410888448894cd40044008884cc014008ccd54c01c480040140100044484888c00c0104484888c004010c8004d540fc8844894cd400454100884cd4104c010008cd54c01848004010004c8004d540f888448894cd40044d400c88004884ccd401488008c010008ccd54c01c4800401401000488ccd5cd19b8f00200103e03d112330012253350021001103d03c1233500222333500322002002001350012200112212330010030022233700004002640026aa07044244a66a0022a05c442a66a600800442600a006266a600c24002008002640026aa06e44244a66a0022074442a66a6008004266a600c240020080022076640026aa06c444a66a0042a66a0022070442072442a66a00620724426a008446a00844a66a666ae68cdc780200102001f8a99a999ab9a3370e00600208007e26601600e00a207e207e2246666666600200644a66a666ae68cdc380100081b81b08040a99a999ab9a3371200400206e06c200c200e44666ae68cdc400100081b81b11199ab9a3371200400206e06c44666ae68cdc480100081b01b80111299a999ab9a3371200400206e06c2002200444a66a666ae68cdc480100081b81b0801080091199ab9a3371000400206806a44666ae68cdc380100081a01989110018911001091100091919191999999aba400423333573466e1cd55cea8022400046666aae7d4010940a08cccd55cfa8021281491999aab9f35744a00a4a66a646666666ae9000404c04c8c03cdd60010098098189aba150072153353335500c00f335500c00f01235742a00e426a05a660180040022a0562a0544a05405e05c05a4a04e0564a04c4a04c4a04c4a04c05626ae8940044d55cf280089baa001221233001003002112232233333335748002aa00a4a66a60066eac00884d4098004540915401554015540140a4c8004d540bc88c8cccd55cf80111a81328181299a98031aab9d5002215335300635573ca00642a66a600c6ae8801484d40a4cd40c8cd540ac00c0080045409c54098540940a84d5d0800889280f990009aa815911999aab9f001235021502b25335323232323333333574800846666ae68cdc39aab9d5004021233335573ea00801646666aae7d40100308cccd55cf9aba2500525335300d35742a00e42a66a60206ae85401c84d40b0cd540b8008004540a8540a40340b80b40b0940980a80240240240240a84d5d1280089aab9e5001137540026ae84008854cd4c010d5d1001909a81199a8160010008a8108a81001291999999aba40012501e2501e2501e2501e23501f375c0040464a038464646666666ae9000c8cccd5cd19b8735573aa006900011999aab9f500325020233335573e6ae89401094cd4c020d5d0a802909a8118008a810928108130129280f8119280f1280f1280f1280f01189aab9e50011375400246666666ae900049406c9406c9406c8d4070dd68011280d8101280ca40002464460046eb0004c8004d5409488cccd55cf80092812919a81218021aba100230033574400403e464646666ae68cdc39aab9d5002480008cc8848cc00400c008c028d5d0a80118029aba135744a004464c6403e66ae7005c07c0744d55cf280089baa0012323232323333573466e1cd55cea8022400046666444424666600200a0080060046464646666ae68cdc39aab9d5002480008cc8848cc00400c008c04cd5d0a80119a8068091aba135744a004464c6404866ae700700900884d55cf280089baa00135742a008666aa010eb9401cd5d0a8019919191999ab9a3370ea0029002119091118010021aba135573ca00646666ae68cdc3a80124004464244460020086eb8d5d09aab9e500423333573466e1d400d20002122200323263202633573803c04c04804604426aae7540044dd50009aba1500233500975c6ae84d5d1280111931901019ab9c01802001e135744a00226ae8940044d55cf280089baa0011335500175ceb44488c88c008dd5800990009aa81111191999aab9f002250232335022335501b300635573aa004600a6aae794008c010d5d100180e89aba100112232323333573466e1d400520002350173005357426aae79400c8cccd5cd19b875002480089405c8c98c8074cd5ce00a80e80d80d09aab9d500113754002464646666ae68cdc3a800a400c46424444600800a600e6ae84d55cf280191999ab9a3370ea004900211909111180100298049aba135573ca00846666ae68cdc3a801a400446424444600200a600e6ae84d55cf280291999ab9a3370ea00890001190911118018029bae357426aae7940188c98c8074cd5ce00a80e80d80d00c80c09aab9d500113754002464646666ae68cdc39aab9d5002480008cc8848cc00400c008c014d5d0a8011bad357426ae8940088c98c8064cd5ce00880c80b89aab9e5001137540024646666ae68cdc39aab9d5001480008dd71aba135573ca004464c6402e66ae7003c05c0544dd5000919191919191999ab9a3370ea002900610911111100191999ab9a3370ea004900510911111100211999ab9a3370ea00690041199109111111198008048041bae35742a00a6eb4d5d09aba2500523333573466e1d40112006233221222222233002009008375c6ae85401cdd71aba135744a00e46666ae68cdc3a802a400846644244444446600c01201060186ae854024dd71aba135744a01246666ae68cdc3a8032400446424444444600e010601a6ae84d55cf280591999ab9a3370ea00e900011909111111180280418071aba135573ca018464c6404066ae7006008007807407006c0680640604d55cea80209aab9e5003135573ca00426aae7940044dd50009191919191999ab9a3370ea002900111999110911998008028020019bad35742a0086eb4d5d0a8019bad357426ae89400c8cccd5cd19b875002480008c8488c00800cc020d5d09aab9e500623263201933573802203202e02c26aae75400c4d5d1280089aab9e500113754002464646666ae68cdc3a800a400446424460020066eb8d5d09aab9e500323333573466e1d400920002321223002003375c6ae84d55cf280211931900b19ab9c00e016014013135573aa00226ea8004488c8c8cccd5cd19b87500148010940188cccd5cd19b875002480088d4024c018d5d09aab9e500423333573466e1d400d20002500923263201733573801e02e02a02802626aae7540044dd5000890911180180208911001089110009191999ab9a3370ea0029001100b11999ab9a3370ea0049000100b11931900819ab9c00801000e00d135573a6ea8004c8004d5404c88cccd55cf80092809919a8091919191999ab9a3370e6aae75400801c8cd5403cdd71aba150023009357426ae8940088c98c8048cd5ce00500900809aab9e5001137540026ae84008c00cd5d1001006a40004646666ae68cdc39aab9d5001480008dd69aba135573ca004464c6401866ae700100300284dd5000a490350543100232632008335738921244578706563746564206f6e6c79206f6e6520636f6e74696e75696e67206f75747075742e00008121223002003112200113263200433573892129436f756c64206e6f74207265736f6c766520666f7220736372697074206f757470757420646174756d00004112212330010030021326320023357389211b436f756c64206e6f74207265736f6c766520666f7220646174756d0000249848004d400888004d400488008cc8c00400488c848d4c848cc0048d400c88c00800c8d400c88c00400c48d4c00c010d4010004004c0080084888cc00c84c00848004848894cd40084004884cc014008ccd54c0204800401400400c4488008488488cc00401000c488008488004448c8c00400488cc00cc008008004cd4488ccd44888cd4488cccc0092211cf24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a004830227072ba58520c089c1cae9613350043355007488100335004335500748900482036b102540154014888848cccc00401401000c00880044488008488488cc00401000c48004448848cc00400c008448005a200583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb101821b00000001f3a70f33a6581c044426e16ecc7fb5cb3408bb91fe1d2a8df13638d4c2c8e2b5e1fcbca14668656c6c6f32190384581c3427abb917beedc18efb72771bb4fc7c01e3428c6a1c0efe3efa1df5a1446b61706918ad581c5be590cffb84692ffc7310c1063c62a9e21ff626f512df4b3d601aaea146686f686f686f181e581c731d82d0b3bd05b0d3de9cc7048ea11916e5fc2838df0d0d4c646099a144686f686f0a581cd0c7f42eb43669f9dbf8e814ae5d9ca89d762f80a7831841e8f24665a14668656c6c6f331903e8581cd963362f2d746cfeb63ce6fc11e2dd5ab176bc357e2dbe048e4a155fa143686f69181ea200583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1011a00177e73021a0007060d0b58202f50ea2546f8ce020ca45bfcf2abeb02ff18af2283466f888ae489184b3d2d39a10481d87980f5f6

Simplified

Just (ShelleyTx ShelleyBasedEraBabbage (ValidatedTx {body = TxBodyConstr TxBodyRaw {_spendInputs = from
List [TxIn (TxId {_unTxId = SafeHash "b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a388"
}) (TxIx 1),TxIn (TxId {_unTxId = SafeHash "b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a00
0a388"}) (TxIx 2)], _collateralInputs = fromList [], _referenceInputs = fromList [], _outputs = StrictS
eq {fromStrict = fromList [Sized {sizedValue = (Addr Testnet (KeyHashObj (KeyHash "f24712bd05f058c6dca5
df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (KeyHash "9f1e4a039e2889728c6b0deca4a
ff7cdfa493d8b503fabdd223c2cb1"))),Value 27506420 (fromList []),DatumHash (SafeHash "923918e403bf43c34b4
ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"),SJust PlutusScript PlutusV2 ScriptHash "b228a5c30779bee
34dbb1ee50c6c65cbd851224e880255ab529037f9"), sizedSize = 6222},Sized {sizedValue = (Addr Testnet (KeyHa
shObj (KeyHash "f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (
KeyHash "9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1"))),Value 8382779187 (fromList [(Poli
cyID {policyID = ScriptHash "044426e16ecc7fb5cb3408bb91fe1d2a8df13638d4c2c8e2b5e1fcbc"},fromList [(6865
6c6c6f32,900)]),(PolicyID {policyID = ScriptHash "3427abb917beedc18efb72771bb4fc7c01e3428c6a1c0efe3efa1
df5"},fromList [(6b617069,173)]),(PolicyID {policyID = ScriptHash "5be590cffb84692ffc7310c1063c62a9e21f
f626f512df4b3d601aae"},fromList [(686f686f686f,30)]),(PolicyID {policyID = ScriptHash "731d82d0b3bd05b0
d3de9cc7048ea11916e5fc2838df0d0d4c646099"},fromList [(686f686f,10)]),(PolicyID {policyID = ScriptHash "
d0c7f42eb43669f9dbf8e814ae5d9ca89d762f80a7831841e8f24665"},fromList [(68656c6c6f33,1000)]),(PolicyID {p
olicyID = ScriptHash "d963362f2d746cfeb63ce6fc11e2dd5ab176bc357e2dbe048e4a155f"},fromList [(686f69,30)]
)]),NoDatum,SNothing), sizedSize = 307},Sized {sizedValue = (Addr Testnet (KeyHashObj (KeyHash "f24712b
d05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (KeyHash "9f1e4a039e2889
728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1"))),Value 1539699 (fromList []),NoDatum,SNothing), sizedSize
 = 67}]}, _collateralReturn = SNothing, _totalCollateral = SNothing, _certs = StrictSeq {fromStrict = f
romList []}, _wdrls = Wdrl {unWdrl = fromList []}, _txfee = Coin 460301, _vldt = ValidityInterval {inva
lidBefore = SNothing, invalidHereafter = SNothing}, _update = SNothing, _reqSignerHashes = fromList [],
 _mint = Value 0 (fromList []), _scriptIntegrityHash = SJust (SafeHash "2f50ea2546f8ce020ca45bfcf2abeb0
2ff18af2283466f888ae489184b3d2d39"), _adHash = SNothing, _txnetworkid = SNothing}, wits = TxWitnessRaw 
{_txwitsVKey = fromList [], _txwitsBoot = fromList [], _txscripts = fromList [], _txdats = TxDatsRaw (f
romList [(SafeHash "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec",DataConstr Constr
 0 [])]), _txrdmrs = RedeemersRaw (fromList [])}, isValid = IsValid True, auxiliaryData = SNothing}))

And then when I sign it, using the code mentioned here (the signTx function), I get:

CBOR

84a40082825820b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a38801825820b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a388020183a400583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1011a01a3b6f40282005820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec03d8185917e082025917db5917d8010000332332233223232323232323232332232323232323233322232323232323232323232323232323232323232323232323233322232323232323232323232323232332232323232323232323232323232323222323223232232323500a2222533532323232323232323232323500b23232322325335010232135011223500222222222222253353335034504b335035335036506a07f3350383506b02407f0051500f1533533573892011e4d757374206265206265666f72652060426574556e74696c602074696d650007e1500f107e135500c2253353303d33506f3355068500a003009002150041533533573892011747756573736573207570646174652069732077726f6e670007115004107113500f22350022222222222225335333503250493350333350343506902107d335036506707d00515011153353357389211a4d757374206265206166746572206052657665616c54696d65600007c15011107c1533533302a03b500933301f036500833301f03600101115007153353357389201515468652063757272656e7420626574206d757374206265206d6f7265207468616e207468652070726576696f7573206265742062792061746c656173742060627270426574537465706020616d6f756e740006d15007106d15335333553067120012206d301e00c06c15001153353357389201174d7573742066756c6c79207370656e64205363726970740006b15001106b15335333573466e3cd540288888d401088cd400880048c98c81accd5ce24811a4e6f7420504b4820666f72206f7261636c6520616464726573730006b01106b06a150011533533573892013e5265666572656e636520696e707574206d7573742062652066726f6d204f7261636c6520616464726573732028777274205061796d656e742070617274290006a15001106a153353353034120012333573466e20c024d400488004c0254cd4cd4c0d04800494cd4ccd5cd19b8f3500122002500406c06b1350600011505f00221350012200113562606a06b001106a1335738921144775657373206973206e6f7420636c6f73657374000691350082235002222222222222533500413263206f33573892010c4e6f207369676e61746f72790006f221533500110022213263207333573892011b4578706563746564206f6e6c79206f6e65207369676e61746f7279000731355003225335333025037001323233301c0330023355302d120012350012233550640023355303012001235001223355067002337049000800800800a80228020834899ab9c491104f7574206265742069732077726f6e67000681533530190062135001223500122220031353263205f33573892118436f756c64206e6f742066696e64206f776e20696e7075740005f22220031355002222200313550012222533350021505d215335303b00121350012233550620020011505e2153353301d0013500922002215335303c00121350012233550630020011505f1505e153353015003130554988854cd40044008884c165262325335333573466e21400410019018c4cdc082028008a800899b813550022222533350021505e2153353041001210011505f2153353301c0013500822002215335304200121001150601505f0011350012235002222222222222533533355302e12001223500222225335001210061335072006005506d33553031120012350012200100b1326320683357389211b4e6f207265666572656e636520696e7075742070726f766964656400068221533500110022213263206c3357389201214578706563746564206f6e6c79206f6e65207265666572656e636520696e7075740006c3333573466e1cd55cea80424000466442466002006004646464646464646464646464646666ae68cdc39aab9d500c480008cccccccccccc88888888888848cccccccccccc00403403002c02802402001c01801401000c008cd4130134d5d0a80619a8260269aba1500b33504c04e35742a014666aa0a0eb9413cd5d0a804999aa8283ae504f35742a01066a0980aa6ae85401cccd54140159d69aba150063232323333573466e1cd55cea80124000466a0526464646666ae68cdc39aab9d5002480008cd40b8cd4181d69aba150023064357426ae8940088c98c81c0cd5ce03403803709aab9e5001137540026ae854008c8c8c8cccd5cd19b8735573aa0049000119a81819a8303ad35742a00460c86ae84d5d1280111931903819ab9c06807006e135573ca00226ea8004d5d09aba2500223263206c3357380c80d80d426aae7940044dd50009aba1500533504c75c6ae854010ccd541401488004d5d0a801999aa8283ae200135742a00460a86ae84d5d1280111931903419ab9c060068066135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d55cf280089baa00135742a01060886ae84d5d1280411931902d19ab9c05205a0583333573466e1d40252002212200123333573466e1d4029200023212230020033051357426aae7940308c98c8168cd5ce02902d02c02b9999ab9a3370e6aae7540312000233032304d37586ae854030ccd54101d7281f9aba135744a018464c640b066ae70140160158415c584d55cf280089baa001135573aa00226ea80044d55cf280089baa001222335530141200123500122335504b002335530171200123500122335504e002333500123300a4800000488cc02c0080048cc02800520000013300f002001253353002001213500122350012222350082235002222222222222333553023120012235002222253353501822350062232335005233500425335333573466e3c0080041c41c05400c41c081c08cd401081c094cd4ccd5cd19b8f002001071070150031070153350032153350022133500223350022335002233500223303800200120732335002207323303800200122207322233500420732225335333573466e1c01800c1d81d454cd4ccd5cd19b8700500207607513304400400110751075106e153350012106e106e13350670060051005506200a1326320483357389201024c660004823500122350022222222222223333500d25050250502505023335530201200133502422533500221003100150502350012253355335333573466e3cd400888008d40108800818017c4ccd5cd19b873500222001350042200106005f105f1350540031505300d232235001222222222222300e0023200135504e2253350011504222135002225335333573466e3c00801c14c1484d411c0044c01800c4888d400888d400888d401488d4008894ccd4ccd404002c01800854cd400454cd40144ccd403802c00c01c41544ccd403802c00c01c41544ccd403802c00c01c48848cc00400c00848848cc00400c0084888d400888d400c894ccd4ccd402401c01000854cd400c4004413c4138413c48848cc00400c0084888c8c8c8c94ccd4018854ccd4018854ccd402084c011261300349854ccd401c84c01126130034984080407854ccd401c84c011261300349854ccd401884c0112613003498407c54ccd4014840744078407054ccd4014854ccd401c84c015261300449854ccd401884c0152613004498407c407454ccd401884c015261300449854ccd401484c0152613004498407894ccd4014854ccd401c854ccd401c84ccd402c028008004585858407854ccd4018854ccd401884ccd40280240080045858584074407094ccd4010854ccd4018854ccd401884ccd4028024008004585858407454ccd4014854ccd401484ccd40240200080045858584070406c94ccd400c854ccd4014854ccd401484ccd4024020008004585858407054ccd4010854ccd401084ccd402001c008004585858406c406894ccd4008854ccd4010854ccd401084ccd402001c008004585858406c54ccd400c854ccd400c84ccd401c0180080045858584068406448d40048888888801c888ccd54c02848004d403540308d400488ccd54c03448004d4041403c8d400488ccd40048cc0292000001223300b00200123300a00148000004cc01000800488cd54c01c480048d400488cd540f8008ccd40048cd54c02c480048d400488cd54108008d5403400400488ccd5540200380080048cd54c02c480048d400488cd54108008d54030004004ccd55400c024008004444888ccd54c010480054108cd54c01c480048d400488cd540f8008d54024004ccd54c0104800488d4008894cd4ccd54c03048004c8cd404488ccd400c88008008004d40048800448cc004894cd4008413040041248d400488cc028008014018400c4cd411801000d410c004cd54c01c480048d400488c8cd540fc00cc004014c8004d54124894cd40044d5402800c884d4008894cd4cc03000802044888cc0080280104c01800c008c8004d5410888448894cd40044008884cc014008ccd54c01c480040140100044484888c00c0104484888c004010c8004d540fc8844894cd400454100884cd4104c010008cd54c01848004010004c8004d540f888448894cd40044d400c88004884ccd401488008c010008ccd54c01c4800401401000488ccd5cd19b8f00200103e03d112330012253350021001103d03c1233500222333500322002002001350012200112212330010030022233700004002640026aa07044244a66a0022a05c442a66a600800442600a006266a600c24002008002640026aa06e44244a66a0022074442a66a6008004266a600c240020080022076640026aa06c444a66a0042a66a0022070442072442a66a00620724426a008446a00844a66a666ae68cdc780200102001f8a99a999ab9a3370e00600208007e26601600e00a207e207e2246666666600200644a66a666ae68cdc380100081b81b08040a99a999ab9a3371200400206e06c200c200e44666ae68cdc400100081b81b11199ab9a3371200400206e06c44666ae68cdc480100081b01b80111299a999ab9a3371200400206e06c2002200444a66a666ae68cdc480100081b81b0801080091199ab9a3371000400206806a44666ae68cdc380100081a01989110018911001091100091919191999999aba400423333573466e1cd55cea8022400046666aae7d4010940a08cccd55cfa8021281491999aab9f35744a00a4a66a646666666ae9000404c04c8c03cdd60010098098189aba150072153353335500c00f335500c00f01235742a00e426a05a660180040022a0562a0544a05405e05c05a4a04e0564a04c4a04c4a04c4a04c05626ae8940044d55cf280089baa001221233001003002112232233333335748002aa00a4a66a60066eac00884d4098004540915401554015540140a4c8004d540bc88c8cccd55cf80111a81328181299a98031aab9d5002215335300635573ca00642a66a600c6ae8801484d40a4cd40c8cd540ac00c0080045409c54098540940a84d5d0800889280f990009aa815911999aab9f001235021502b25335323232323333333574800846666ae68cdc39aab9d5004021233335573ea00801646666aae7d40100308cccd55cf9aba2500525335300d35742a00e42a66a60206ae85401c84d40b0cd540b8008004540a8540a40340b80b40b0940980a80240240240240a84d5d1280089aab9e5001137540026ae84008854cd4c010d5d1001909a81199a8160010008a8108a81001291999999aba40012501e2501e2501e2501e23501f375c0040464a038464646666666ae9000c8cccd5cd19b8735573aa006900011999aab9f500325020233335573e6ae89401094cd4c020d5d0a802909a8118008a810928108130129280f8119280f1280f1280f1280f01189aab9e50011375400246666666ae900049406c9406c9406c8d4070dd68011280d8101280ca40002464460046eb0004c8004d5409488cccd55cf80092812919a81218021aba100230033574400403e464646666ae68cdc39aab9d5002480008cc8848cc00400c008c028d5d0a80118029aba135744a004464c6403e66ae7005c07c0744d55cf280089baa0012323232323333573466e1cd55cea8022400046666444424666600200a0080060046464646666ae68cdc39aab9d5002480008cc8848cc00400c008c04cd5d0a80119a8068091aba135744a004464c6404866ae700700900884d55cf280089baa00135742a008666aa010eb9401cd5d0a8019919191999ab9a3370ea0029002119091118010021aba135573ca00646666ae68cdc3a80124004464244460020086eb8d5d09aab9e500423333573466e1d400d20002122200323263202633573803c04c04804604426aae7540044dd50009aba1500233500975c6ae84d5d1280111931901019ab9c01802001e135744a00226ae8940044d55cf280089baa0011335500175ceb44488c88c008dd5800990009aa81111191999aab9f002250232335022335501b300635573aa004600a6aae794008c010d5d100180e89aba100112232323333573466e1d400520002350173005357426aae79400c8cccd5cd19b875002480089405c8c98c8074cd5ce00a80e80d80d09aab9d500113754002464646666ae68cdc3a800a400c46424444600800a600e6ae84d55cf280191999ab9a3370ea004900211909111180100298049aba135573ca00846666ae68cdc3a801a400446424444600200a600e6ae84d55cf280291999ab9a3370ea00890001190911118018029bae357426aae7940188c98c8074cd5ce00a80e80d80d00c80c09aab9d500113754002464646666ae68cdc39aab9d5002480008cc8848cc00400c008c014d5d0a8011bad357426ae8940088c98c8064cd5ce00880c80b89aab9e5001137540024646666ae68cdc39aab9d5001480008dd71aba135573ca004464c6402e66ae7003c05c0544dd5000919191919191999ab9a3370ea002900610911111100191999ab9a3370ea004900510911111100211999ab9a3370ea00690041199109111111198008048041bae35742a00a6eb4d5d09aba2500523333573466e1d40112006233221222222233002009008375c6ae85401cdd71aba135744a00e46666ae68cdc3a802a400846644244444446600c01201060186ae854024dd71aba135744a01246666ae68cdc3a8032400446424444444600e010601a6ae84d55cf280591999ab9a3370ea00e900011909111111180280418071aba135573ca018464c6404066ae7006008007807407006c0680640604d55cea80209aab9e5003135573ca00426aae7940044dd50009191919191999ab9a3370ea002900111999110911998008028020019bad35742a0086eb4d5d0a8019bad357426ae89400c8cccd5cd19b875002480008c8488c00800cc020d5d09aab9e500623263201933573802203202e02c26aae75400c4d5d1280089aab9e500113754002464646666ae68cdc3a800a400446424460020066eb8d5d09aab9e500323333573466e1d400920002321223002003375c6ae84d55cf280211931900b19ab9c00e016014013135573aa00226ea8004488c8c8cccd5cd19b87500148010940188cccd5cd19b875002480088d4024c018d5d09aab9e500423333573466e1d400d20002500923263201733573801e02e02a02802626aae7540044dd5000890911180180208911001089110009191999ab9a3370ea0029001100b11999ab9a3370ea0049000100b11931900819ab9c00801000e00d135573a6ea8004c8004d5404c88cccd55cf80092809919a8091919191999ab9a3370e6aae75400801c8cd5403cdd71aba150023009357426ae8940088c98c8048cd5ce00500900809aab9e5001137540026ae84008c00cd5d1001006a40004646666ae68cdc39aab9d5001480008dd69aba135573ca004464c6401866ae700100300284dd5000a490350543100232632008335738921244578706563746564206f6e6c79206f6e6520636f6e74696e75696e67206f75747075742e00008121223002003112200113263200433573892129436f756c64206e6f74207265736f6c766520666f7220736372697074206f757470757420646174756d00004112212330010030021326320023357389211b436f756c64206e6f74207265736f6c766520666f7220646174756d0000249848004d400888004d400488008cc8c00400488c848d4c848cc0048d400c88c00800c8d400c88c00400c48d4c00c010d4010004004c0080084888cc00c84c00848004848894cd40084004884cc014008ccd54c0204800401400400c4488008488488cc00401000c488008488004448c8c00400488cc00cc008008004cd4488ccd44888cd4488cccc0092211cf24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a004830227072ba58520c089c1cae9613350043355007488100335004335500748900482036b102540154014888848cccc00401401000c00880044488008488488cc00401000c48004448848cc00400c00844800582583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1821b00000001f3a70f33a6581c044426e16ecc7fb5cb3408bb91fe1d2a8df13638d4c2c8e2b5e1fcbca14668656c6c6f32190384581c3427abb917beedc18efb72771bb4fc7c01e3428c6a1c0efe3efa1df5a1446b61706918ad581c5be590cffb84692ffc7310c1063c62a9e21ff626f512df4b3d601aaea146686f686f686f181e581c731d82d0b3bd05b0d3de9cc7048ea11916e5fc2838df0d0d4c646099a144686f686f0a581cd0c7f42eb43669f9dbf8e814ae5d9ca89d762f80a7831841e8f24665a14668656c6c6f331903e8581cd963362f2d746cfeb63ce6fc11e2dd5ab176bc357e2dbe048e4a155fa143686f69181e82583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb11a00177e73021a0007060d0b58202f50ea2546f8ce020ca45bfcf2abeb02ff18af2283466f888ae489184b3d2d39a200818258206400a17ee58ce12a54c6edb7b964f0eb217e00dac75f2a47eccb6eedd02809a45840029f1cbdaf733ef2aa6e1493b308844f32d4cacae206acd6c6f2d419c3d7e4a2d86ae799fff44f94f954b95959d0fd1f3c5c6d9cab2cfac52de25fae8a4c810c0481d87980f5f6

Simplified

Just (ShelleyTx ShelleyBasedEraBabbage (ValidatedTx {body = TxBodyConstr TxBodyRaw {_spendInputs = from
List [TxIn (TxId {_unTxId = SafeHash "b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a388"
}) (TxIx 1),TxIn (TxId {_unTxId = SafeHash "b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a00
0a388"}) (TxIx 2)], _collateralInputs = fromList [], _referenceInputs = fromList [], _outputs = StrictS
eq {fromStrict = fromList [Sized {sizedValue = (Addr Testnet (KeyHashObj (KeyHash "f24712bd05f058c6dca5
df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (KeyHash "9f1e4a039e2889728c6b0deca4a
ff7cdfa493d8b503fabdd223c2cb1"))),Value 27506420 (fromList []),DatumHash (SafeHash "923918e403bf43c34b4
ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"),SJust PlutusScript PlutusV2 ScriptHash "b228a5c30779bee
34dbb1ee50c6c65cbd851224e880255ab529037f9"), sizedSize = 6222},Sized {sizedValue = (Addr Testnet (KeyHa
shObj (KeyHash "f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (
KeyHash "9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1"))),Value 8382779187 (fromList [(Poli
cyID {policyID = ScriptHash "044426e16ecc7fb5cb3408bb91fe1d2a8df13638d4c2c8e2b5e1fcbc"},fromList [(6865
6c6c6f32,900)]),(PolicyID {policyID = ScriptHash "3427abb917beedc18efb72771bb4fc7c01e3428c6a1c0efe3efa1
df5"},fromList [(6b617069,173)]),(PolicyID {policyID = ScriptHash "5be590cffb84692ffc7310c1063c62a9e21f
f626f512df4b3d601aae"},fromList [(686f686f686f,30)]),(PolicyID {policyID = ScriptHash "731d82d0b3bd05b0
d3de9cc7048ea11916e5fc2838df0d0d4c646099"},fromList [(686f686f,10)]),(PolicyID {policyID = ScriptHash "
d0c7f42eb43669f9dbf8e814ae5d9ca89d762f80a7831841e8f24665"},fromList [(68656c6c6f33,1000)]),(PolicyID {p
olicyID = ScriptHash "d963362f2d746cfeb63ce6fc11e2dd5ab176bc357e2dbe048e4a155f"},fromList [(686f69,30)]
)]),NoDatum,SNothing), sizedSize = 305},Sized {sizedValue = (Addr Testnet (KeyHashObj (KeyHash "f24712b
d05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (KeyHash "9f1e4a039e2889
728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1"))),Value 1539699 (fromList []),NoDatum,SNothing), sizedSize
 = 65}]}, _collateralReturn = SNothing, _totalCollateral = SNothing, _certs = StrictSeq {fromStrict = f
romList []}, _wdrls = Wdrl {unWdrl = fromList []}, _txfee = Coin 460301, _vldt = ValidityInterval {inva
lidBefore = SNothing, invalidHereafter = SNothing}, _update = SNothing, _reqSignerHashes = fromList [],
 _mint = Value 0 (fromList []), _scriptIntegrityHash = SJust (SafeHash "2f50ea2546f8ce020ca45bfcf2abeb0
2ff18af2283466f888ae489184b3d2d39"), _adHash = SNothing, _txnetworkid = SNothing}, wits = TxWitnessRaw 
{_txwitsVKey = fromList [WitVKey' {wvkKey' = VKey (VerKeyEd25519DSIGN "6400a17ee58ce12a54c6edb7b964f0eb
217e00dac75f2a47eccb6eedd02809a4"), wvkSig' = SignedDSIGN (SigEd25519DSIGN "029f1cbdaf733ef2aa6e1493b30
8844f32d4cacae206acd6c6f2d419c3d7e4a2d86ae799fff44f94f954b95959d0fd1f3c5c6d9cab2cfac52de25fae8a4c810c")
, wvkKeyHash = KeyHash "f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a", wvkBytes = "\130X d\
NUL\161~\229\140\225*T\198\237\183\185d\240\235!~\NUL\218\199_*G\236\203n\237\208(\t\164X@\STX\159\FS\1
89\175s>\242\170n\DC4\147\179\b\132O2\212\202\202\226\ACK\172\214\198\242\212\EM\195\215\228\162\216j\2
31\153\255\244O\148\249T\185YY\208\253\US<\\m\156\171,\250\197-\226_\174\138L\129\f"}], _txwitsBoot = f
romList [], _txscripts = fromList [], _txdats = TxDatsRaw (fromList [(SafeHash "923918e403bf43c34b4ef6b
48eb2ee04babed17320d8d1b9ff9ad086e86f44ec",DataConstr Constr 0 [])]), _txrdmrs = RedeemersRaw (fromList
 [])}, isValid = IsValid True, auxiliaryData = SNothing}))

Which basically populates entry in txwitsVKey (comparing unsigned one with now signed one): image

I can successfully submit this transaction.

However, if I try to sign using lucid, I get:

Note I did the signing this way:

  const lucid = await Lucid.new(undefined, "Preprod");
  lucid.selectWallet(api);
  const lucidTxComplete = lucid.fromTx(txRaw);
  const lucidTxSigned = await lucidTxComplete.sign().complete();
  const lucidTxSignedString = lucidTxSigned.toString();
  console.log("Lucid's final tx cbor: ", lucidTxSigned.toString());

CBOR

84a40082825820b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a38801825820b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a388020183a400583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1011a01a3b6f40282005820923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec03d8185917e082025917db5917d8010000332332233223232323232323232332232323232323233322232323232323232323232323232323232323232323232323233322232323232323232323232323232332232323232323232323232323232323222323223232232323500a2222533532323232323232323232323500b23232322325335010232135011223500222222222222253353335034504b335035335036506a07f3350383506b02407f0051500f1533533573892011e4d757374206265206265666f72652060426574556e74696c602074696d650007e1500f107e135500c2253353303d33506f3355068500a003009002150041533533573892011747756573736573207570646174652069732077726f6e670007115004107113500f22350022222222222225335333503250493350333350343506902107d335036506707d00515011153353357389211a4d757374206265206166746572206052657665616c54696d65600007c15011107c1533533302a03b500933301f036500833301f03600101115007153353357389201515468652063757272656e7420626574206d757374206265206d6f7265207468616e207468652070726576696f7573206265742062792061746c656173742060627270426574537465706020616d6f756e740006d15007106d15335333553067120012206d301e00c06c15001153353357389201174d7573742066756c6c79207370656e64205363726970740006b15001106b15335333573466e3cd540288888d401088cd400880048c98c81accd5ce24811a4e6f7420504b4820666f72206f7261636c6520616464726573730006b01106b06a150011533533573892013e5265666572656e636520696e707574206d7573742062652066726f6d204f7261636c6520616464726573732028777274205061796d656e742070617274290006a15001106a153353353034120012333573466e20c024d400488004c0254cd4cd4c0d04800494cd4ccd5cd19b8f3500122002500406c06b1350600011505f00221350012200113562606a06b001106a1335738921144775657373206973206e6f7420636c6f73657374000691350082235002222222222222533500413263206f33573892010c4e6f207369676e61746f72790006f221533500110022213263207333573892011b4578706563746564206f6e6c79206f6e65207369676e61746f7279000731355003225335333025037001323233301c0330023355302d120012350012233550640023355303012001235001223355067002337049000800800800a80228020834899ab9c491104f7574206265742069732077726f6e67000681533530190062135001223500122220031353263205f33573892118436f756c64206e6f742066696e64206f776e20696e7075740005f22220031355002222200313550012222533350021505d215335303b00121350012233550620020011505e2153353301d0013500922002215335303c00121350012233550630020011505f1505e153353015003130554988854cd40044008884c165262325335333573466e21400410019018c4cdc082028008a800899b813550022222533350021505e2153353041001210011505f2153353301c0013500822002215335304200121001150601505f0011350012235002222222222222533533355302e12001223500222225335001210061335072006005506d33553031120012350012200100b1326320683357389211b4e6f207265666572656e636520696e7075742070726f766964656400068221533500110022213263206c3357389201214578706563746564206f6e6c79206f6e65207265666572656e636520696e7075740006c3333573466e1cd55cea80424000466442466002006004646464646464646464646464646666ae68cdc39aab9d500c480008cccccccccccc88888888888848cccccccccccc00403403002c02802402001c01801401000c008cd4130134d5d0a80619a8260269aba1500b33504c04e35742a014666aa0a0eb9413cd5d0a804999aa8283ae504f35742a01066a0980aa6ae85401cccd54140159d69aba150063232323333573466e1cd55cea80124000466a0526464646666ae68cdc39aab9d5002480008cd40b8cd4181d69aba150023064357426ae8940088c98c81c0cd5ce03403803709aab9e5001137540026ae854008c8c8c8cccd5cd19b8735573aa0049000119a81819a8303ad35742a00460c86ae84d5d1280111931903819ab9c06807006e135573ca00226ea8004d5d09aba2500223263206c3357380c80d80d426aae7940044dd50009aba1500533504c75c6ae854010ccd541401488004d5d0a801999aa8283ae200135742a00460a86ae84d5d1280111931903419ab9c060068066135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d55cf280089baa00135742a01060886ae84d5d1280411931902d19ab9c05205a0583333573466e1d40252002212200123333573466e1d4029200023212230020033051357426aae7940308c98c8168cd5ce02902d02c02b9999ab9a3370e6aae7540312000233032304d37586ae854030ccd54101d7281f9aba135744a018464c640b066ae70140160158415c584d55cf280089baa001135573aa00226ea80044d55cf280089baa001222335530141200123500122335504b002335530171200123500122335504e002333500123300a4800000488cc02c0080048cc02800520000013300f002001253353002001213500122350012222350082235002222222222222333553023120012235002222253353501822350062232335005233500425335333573466e3c0080041c41c05400c41c081c08cd401081c094cd4ccd5cd19b8f002001071070150031070153350032153350022133500223350022335002233500223303800200120732335002207323303800200122207322233500420732225335333573466e1c01800c1d81d454cd4ccd5cd19b8700500207607513304400400110751075106e153350012106e106e13350670060051005506200a1326320483357389201024c660004823500122350022222222222223333500d25050250502505023335530201200133502422533500221003100150502350012253355335333573466e3cd400888008d40108800818017c4ccd5cd19b873500222001350042200106005f105f1350540031505300d232235001222222222222300e0023200135504e2253350011504222135002225335333573466e3c00801c14c1484d411c0044c01800c4888d400888d400888d401488d4008894ccd4ccd404002c01800854cd400454cd40144ccd403802c00c01c41544ccd403802c00c01c41544ccd403802c00c01c48848cc00400c00848848cc00400c0084888d400888d400c894ccd4ccd402401c01000854cd400c4004413c4138413c48848cc00400c0084888c8c8c8c94ccd4018854ccd4018854ccd402084c011261300349854ccd401c84c01126130034984080407854ccd401c84c011261300349854ccd401884c0112613003498407c54ccd4014840744078407054ccd4014854ccd401c84c015261300449854ccd401884c0152613004498407c407454ccd401884c015261300449854ccd401484c0152613004498407894ccd4014854ccd401c854ccd401c84ccd402c028008004585858407854ccd4018854ccd401884ccd40280240080045858584074407094ccd4010854ccd4018854ccd401884ccd4028024008004585858407454ccd4014854ccd401484ccd40240200080045858584070406c94ccd400c854ccd4014854ccd401484ccd4024020008004585858407054ccd4010854ccd401084ccd402001c008004585858406c406894ccd4008854ccd4010854ccd401084ccd402001c008004585858406c54ccd400c854ccd400c84ccd401c0180080045858584068406448d40048888888801c888ccd54c02848004d403540308d400488ccd54c03448004d4041403c8d400488ccd40048cc0292000001223300b00200123300a00148000004cc01000800488cd54c01c480048d400488cd540f8008ccd40048cd54c02c480048d400488cd54108008d5403400400488ccd5540200380080048cd54c02c480048d400488cd54108008d54030004004ccd55400c024008004444888ccd54c010480054108cd54c01c480048d400488cd540f8008d54024004ccd54c0104800488d4008894cd4ccd54c03048004c8cd404488ccd400c88008008004d40048800448cc004894cd4008413040041248d400488cc028008014018400c4cd411801000d410c004cd54c01c480048d400488c8cd540fc00cc004014c8004d54124894cd40044d5402800c884d4008894cd4cc03000802044888cc0080280104c01800c008c8004d5410888448894cd40044008884cc014008ccd54c01c480040140100044484888c00c0104484888c004010c8004d540fc8844894cd400454100884cd4104c010008cd54c01848004010004c8004d540f888448894cd40044d400c88004884ccd401488008c010008ccd54c01c4800401401000488ccd5cd19b8f00200103e03d112330012253350021001103d03c1233500222333500322002002001350012200112212330010030022233700004002640026aa07044244a66a0022a05c442a66a600800442600a006266a600c24002008002640026aa06e44244a66a0022074442a66a6008004266a600c240020080022076640026aa06c444a66a0042a66a0022070442072442a66a00620724426a008446a00844a66a666ae68cdc780200102001f8a99a999ab9a3370e00600208007e26601600e00a207e207e2246666666600200644a66a666ae68cdc380100081b81b08040a99a999ab9a3371200400206e06c200c200e44666ae68cdc400100081b81b11199ab9a3371200400206e06c44666ae68cdc480100081b01b80111299a999ab9a3371200400206e06c2002200444a66a666ae68cdc480100081b81b0801080091199ab9a3371000400206806a44666ae68cdc380100081a01989110018911001091100091919191999999aba400423333573466e1cd55cea8022400046666aae7d4010940a08cccd55cfa8021281491999aab9f35744a00a4a66a646666666ae9000404c04c8c03cdd60010098098189aba150072153353335500c00f335500c00f01235742a00e426a05a660180040022a0562a0544a05405e05c05a4a04e0564a04c4a04c4a04c4a04c05626ae8940044d55cf280089baa001221233001003002112232233333335748002aa00a4a66a60066eac00884d4098004540915401554015540140a4c8004d540bc88c8cccd55cf80111a81328181299a98031aab9d5002215335300635573ca00642a66a600c6ae8801484d40a4cd40c8cd540ac00c0080045409c54098540940a84d5d0800889280f990009aa815911999aab9f001235021502b25335323232323333333574800846666ae68cdc39aab9d5004021233335573ea00801646666aae7d40100308cccd55cf9aba2500525335300d35742a00e42a66a60206ae85401c84d40b0cd540b8008004540a8540a40340b80b40b0940980a80240240240240a84d5d1280089aab9e5001137540026ae84008854cd4c010d5d1001909a81199a8160010008a8108a81001291999999aba40012501e2501e2501e2501e23501f375c0040464a038464646666666ae9000c8cccd5cd19b8735573aa006900011999aab9f500325020233335573e6ae89401094cd4c020d5d0a802909a8118008a810928108130129280f8119280f1280f1280f1280f01189aab9e50011375400246666666ae900049406c9406c9406c8d4070dd68011280d8101280ca40002464460046eb0004c8004d5409488cccd55cf80092812919a81218021aba100230033574400403e464646666ae68cdc39aab9d5002480008cc8848cc00400c008c028d5d0a80118029aba135744a004464c6403e66ae7005c07c0744d55cf280089baa0012323232323333573466e1cd55cea8022400046666444424666600200a0080060046464646666ae68cdc39aab9d5002480008cc8848cc00400c008c04cd5d0a80119a8068091aba135744a004464c6404866ae700700900884d55cf280089baa00135742a008666aa010eb9401cd5d0a8019919191999ab9a3370ea0029002119091118010021aba135573ca00646666ae68cdc3a80124004464244460020086eb8d5d09aab9e500423333573466e1d400d20002122200323263202633573803c04c04804604426aae7540044dd50009aba1500233500975c6ae84d5d1280111931901019ab9c01802001e135744a00226ae8940044d55cf280089baa0011335500175ceb44488c88c008dd5800990009aa81111191999aab9f002250232335022335501b300635573aa004600a6aae794008c010d5d100180e89aba100112232323333573466e1d400520002350173005357426aae79400c8cccd5cd19b875002480089405c8c98c8074cd5ce00a80e80d80d09aab9d500113754002464646666ae68cdc3a800a400c46424444600800a600e6ae84d55cf280191999ab9a3370ea004900211909111180100298049aba135573ca00846666ae68cdc3a801a400446424444600200a600e6ae84d55cf280291999ab9a3370ea00890001190911118018029bae357426aae7940188c98c8074cd5ce00a80e80d80d00c80c09aab9d500113754002464646666ae68cdc39aab9d5002480008cc8848cc00400c008c014d5d0a8011bad357426ae8940088c98c8064cd5ce00880c80b89aab9e5001137540024646666ae68cdc39aab9d5001480008dd71aba135573ca004464c6402e66ae7003c05c0544dd5000919191919191999ab9a3370ea002900610911111100191999ab9a3370ea004900510911111100211999ab9a3370ea00690041199109111111198008048041bae35742a00a6eb4d5d09aba2500523333573466e1d40112006233221222222233002009008375c6ae85401cdd71aba135744a00e46666ae68cdc3a802a400846644244444446600c01201060186ae854024dd71aba135744a01246666ae68cdc3a8032400446424444444600e010601a6ae84d55cf280591999ab9a3370ea00e900011909111111180280418071aba135573ca018464c6404066ae7006008007807407006c0680640604d55cea80209aab9e5003135573ca00426aae7940044dd50009191919191999ab9a3370ea002900111999110911998008028020019bad35742a0086eb4d5d0a8019bad357426ae89400c8cccd5cd19b875002480008c8488c00800cc020d5d09aab9e500623263201933573802203202e02c26aae75400c4d5d1280089aab9e500113754002464646666ae68cdc3a800a400446424460020066eb8d5d09aab9e500323333573466e1d400920002321223002003375c6ae84d55cf280211931900b19ab9c00e016014013135573aa00226ea8004488c8c8cccd5cd19b87500148010940188cccd5cd19b875002480088d4024c018d5d09aab9e500423333573466e1d400d20002500923263201733573801e02e02a02802626aae7540044dd5000890911180180208911001089110009191999ab9a3370ea0029001100b11999ab9a3370ea0049000100b11931900819ab9c00801000e00d135573a6ea8004c8004d5404c88cccd55cf80092809919a8091919191999ab9a3370e6aae75400801c8cd5403cdd71aba150023009357426ae8940088c98c8048cd5ce00500900809aab9e5001137540026ae84008c00cd5d1001006a40004646666ae68cdc39aab9d5001480008dd69aba135573ca004464c6401866ae700100300284dd5000a490350543100232632008335738921244578706563746564206f6e6c79206f6e6520636f6e74696e75696e67206f75747075742e00008121223002003112200113263200433573892129436f756c64206e6f74207265736f6c766520666f7220736372697074206f757470757420646174756d00004112212330010030021326320023357389211b436f756c64206e6f74207265736f6c766520666f7220646174756d0000249848004d400888004d400488008cc8c00400488c848d4c848cc0048d400c88c00800c8d400c88c00400c48d4c00c010d4010004004c0080084888cc00c84c00848004848894cd40084004884cc014008ccd54c0204800401400400c4488008488488cc00401000c488008488004448c8c00400488cc00cc008008004cd4488ccd44888cd4488cccc0092211cf24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a004830227072ba58520c089c1cae9613350043355007488100335004335500748900482036b102540154014888848cccc00401401000c00880044488008488488cc00401000c48004448848cc00400c008448005a200583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb101821b00000001f3a70f33a6581c044426e16ecc7fb5cb3408bb91fe1d2a8df13638d4c2c8e2b5e1fcbca14668656c6c6f32190384581c3427abb917beedc18efb72771bb4fc7c01e3428c6a1c0efe3efa1df5a1446b61706918ad581c5be590cffb84692ffc7310c1063c62a9e21ff626f512df4b3d601aaea146686f686f686f181e581c731d82d0b3bd05b0d3de9cc7048ea11916e5fc2838df0d0d4c646099a144686f686f0a581cd0c7f42eb43669f9dbf8e814ae5d9ca89d762f80a7831841e8f24665a14668656c6c6f331903e8581cd963362f2d746cfeb63ce6fc11e2dd5ab176bc357e2dbe048e4a155fa143686f69181ea200583900f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1011a00177e73021a0007060d0b58202f50ea2546f8ce020ca45bfcf2abeb02ff18af2283466f888ae489184b3d2d39a200818258206400a17ee58ce12a54c6edb7b964f0eb217e00dac75f2a47eccb6eedd02809a45840ce6faa012da673368d20a3b24e9285ac7b3962b0751311ded977dbd615c2208dbd591b50c7a6d1782152632bc1a0a679497e3479b9607bf5e454a7d6628fd303049fd87980fff5f6

Simplified

Just (ShelleyTx ShelleyBasedEraBabbage (ValidatedTx {body = TxBodyConstr TxBodyRaw {_spendInputs = from
List [TxIn (TxId {_unTxId = SafeHash "b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a000a388"
}) (TxIx 1),TxIn (TxId {_unTxId = SafeHash "b7a6932f2718f914c4cf0e3ee96abe93b03e0f7519a7e8c70920a936a00
0a388"}) (TxIx 2)], _collateralInputs = fromList [], _referenceInputs = fromList [], _outputs = StrictS
eq {fromStrict = fromList [Sized {sizedValue = (Addr Testnet (KeyHashObj (KeyHash "f24712bd05f058c6dca5
df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (KeyHash "9f1e4a039e2889728c6b0deca4a
ff7cdfa493d8b503fabdd223c2cb1"))),Value 27506420 (fromList []),DatumHash (SafeHash "923918e403bf43c34b4
ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec"),SJust PlutusScript PlutusV2 ScriptHash "b228a5c30779bee
34dbb1ee50c6c65cbd851224e880255ab529037f9"), sizedSize = 6222},Sized {sizedValue = (Addr Testnet (KeyHa
shObj (KeyHash "f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (
KeyHash "9f1e4a039e2889728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1"))),Value 8382779187 (fromList [(Poli
cyID {policyID = ScriptHash "044426e16ecc7fb5cb3408bb91fe1d2a8df13638d4c2c8e2b5e1fcbc"},fromList [(6865
6c6c6f32,900)]),(PolicyID {policyID = ScriptHash "3427abb917beedc18efb72771bb4fc7c01e3428c6a1c0efe3efa1
df5"},fromList [(6b617069,173)]),(PolicyID {policyID = ScriptHash "5be590cffb84692ffc7310c1063c62a9e21f
f626f512df4b3d601aae"},fromList [(686f686f686f,30)]),(PolicyID {policyID = ScriptHash "731d82d0b3bd05b0
d3de9cc7048ea11916e5fc2838df0d0d4c646099"},fromList [(686f686f,10)]),(PolicyID {policyID = ScriptHash "
d0c7f42eb43669f9dbf8e814ae5d9ca89d762f80a7831841e8f24665"},fromList [(68656c6c6f33,1000)]),(PolicyID {p
olicyID = ScriptHash "d963362f2d746cfeb63ce6fc11e2dd5ab176bc357e2dbe048e4a155f"},fromList [(686f69,30)]
)]),NoDatum,SNothing), sizedSize = 307},Sized {sizedValue = (Addr Testnet (KeyHashObj (KeyHash "f24712b
d05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a")) (StakeRefBase (KeyHashObj (KeyHash "9f1e4a039e2889
728c6b0deca4aff7cdfa493d8b503fabdd223c2cb1"))),Value 1539699 (fromList []),NoDatum,SNothing), sizedSize
 = 67}]}, _collateralReturn = SNothing, _totalCollateral = SNothing, _certs = StrictSeq {fromStrict = f
romList []}, _wdrls = Wdrl {unWdrl = fromList []}, _txfee = Coin 460301, _vldt = ValidityInterval {inva
lidBefore = SNothing, invalidHereafter = SNothing}, _update = SNothing, _reqSignerHashes = fromList [],
 _mint = Value 0 (fromList []), _scriptIntegrityHash = SJust (SafeHash "2f50ea2546f8ce020ca45bfcf2abeb0
2ff18af2283466f888ae489184b3d2d39"), _adHash = SNothing, _txnetworkid = SNothing}, wits = TxWitnessRaw 
{_txwitsVKey = fromList [WitVKey' {wvkKey' = VKey (VerKeyEd25519DSIGN "6400a17ee58ce12a54c6edb7b964f0eb
217e00dac75f2a47eccb6eedd02809a4"), wvkSig' = SignedDSIGN (SigEd25519DSIGN "ce6faa012da673368d20a3b24e9
285ac7b3962b0751311ded977dbd615c2208dbd591b50c7a6d1782152632bc1a0a679497e3479b9607bf5e454a7d6628fd303")
, wvkKeyHash = KeyHash "f24712bd05f058c6dca5df794f6afbffa8392076e7cb9fda9f508d7a", wvkBytes = "\130X d\
NUL\161~\229\140\225*T\198\237\183\185d\240\235!~\NUL\218\199_*G\236\203n\237\208(\t\164X@\206o\170\SOH
-\166s6\141 \163\178N\146\133\172{9b\176u\DC3\DC1\222\217w\219\214\NAK\194 \141\189Y\ESCP\199\166\209x!
Rc+\193\160\166yI~4y\185`{\245\228T\167\214b\143\211\ETX"}], _txwitsBoot = fromList [], _txscripts = fr
omList [], _txdats = TxDatsRaw (fromList [(SafeHash "923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff
9ad086e86f44ec",DataConstr Constr 0 [])]), _txrdmrs = RedeemersRaw (fromList [])}, isValid = IsValid Tr
ue, auxiliaryData = SNothing}))

Compared to previous one, the difference is mainly in txwitsVKey image

Issue: I am unable to submit ones signed by lucid. It would be nice if we can have lucid interoperable with transactions built using Atlas. In particular, I see this error when submitting:

ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash \\\"2f50ea2546f8ce020ca45bfcf2abeb02ff18af2283466f888ae489184b3d2d39\\\")) (SJust (SafeHash \\\"15dd0a3ac1244430aacc7e95c2734b51f1a8cf2aaf05e5d6e8124cb78ab54cc9\\\"))))])\""})

If required, to reproduce:

  1. Enter this: https://github.com/geniusyield/atlas-examples/tree/main/bet-ref, populating config.json taking cues from config.sample.json can run the server via cabal run betref-server -- config.json.
  2. Being in this branch: https://github.com/geniusyield/atlas-docs/tree/lucid, run yarn followed by yarn run dev to run the site locally and try the "Then lets make our first request to add for reference script:" operation in "Browser Integration" page of "Getting Started" section in Documentation.
alessandrokonrad commented 1 year ago

ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash \\"2f50ea2546f8ce020ca45bfcf2abeb02ff18af2283466f888ae489184b3d2d39\\")) (SJust (SafeHash \\"15dd0a3ac1244430aacc7e95c2734b51f1a8cf2aaf05e5d6e8124cb78ab54cc9\\"))))])\""})

This is not a signing issue and has nothing to do with Lucid. The construction of the tx is wrong or redeemers/datums were not added correctly to the witness set by atlas. PPViewHashesDontMatch refers to the script data hash in the body and it doesn't match with the hash that is constructed by datums + redeemers + cost models.

All the cbor transactions seem to have small differences (I looked at the length). So it's obvious the vkey witnesses are different. But I'm not sure if this is what you are even referring to?

sourabhxyz commented 1 year ago

@alessandrokonrad Thanks,

image Looking at the definition of scriptIntegrityHash, there seems to be no change in $\text{languages }txw$, $\text{txrdmrs }txw$ & $\text{txdats }txw$ ($pp$ is not part of body) b/w these different transaction bodies so it's a bit odd to see that one (using the signTx code here) is valid and can be successfully submitted whereas the other one using lucid can't be.

Yes the difference in signature is expected as transaction body itself is changed b/w these two as somehow some of sizedSize value in transaction outputs gets changed by that signTx function.

Looking more into what specifically caused PPViewHashesDontMatch to be thrown by ledger, thanks for your response.

alessandrokonrad commented 1 year ago

https://github.com/input-output-hk/cardano-ledger/releases/latest/download/alonzo-ledger.pdf

According to 3.1 in the specs datums are indexed by their hashes and redeemers by the redeemer pointer.

The official CML keeps datums and redeemers by insertion order, which is not correct: https://github.com/dcSpark/cardano-multiplatform-lib/blob/31df57ad10c585ad8f0d469990afc525d3dd0e4d/rust/src/builders/witness_builder.rs#L231-L232

Lucid on the other hand uses BTreeMap to index the datums and redeemers according to specs: https://github.com/spacebudz/lucid/blob/ef49aff3a1128c40895b04116e8d2359b5eabedc/src/core/libs/cardano_multiplatform_lib/src/witness_builder.rs#L213-L214

sourabhxyz commented 1 year ago

@alessandrokonrad After a lot of testing, I now understand where the issue is. The thing is that when performing the signTx operation in browser wallet api (as in case of nami), they modify the transaction cbor when deserializing where they simplify the transaction outputs to legacy format when possible https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/test-suite/cddl-files/babbage.cddl#L79. Initial cbor I gave had all the outputs in post_alonzo_transaction_output but after deserialization by CSL/CML, outputs which didn't weren't using babbage era features got simplified to legacy_transaction_output.

alessandrokonrad commented 1 year ago

What is the error you get?

Because this:

ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch (SJust (SafeHash \\\"2f50ea2546f8ce020ca45bfcf2abeb02ff18af2283466f888ae489184b3d2d39\\\")) (SJust (SafeHash \\\"15dd0a3ac1244430aacc7e95c2734b51f1a8cf2aaf05e5d6e8124cb78ab54cc9\\\"))))])\""})

has nothing to do with it.

I also think that Nami keeps the original bytes when deserializing and adds the signature on the original bytes.

sourabhxyz commented 1 year ago

@alessandrokonrad

I also think that Nami keeps the original bytes when deserializing and adds the signature on the original bytes.

Seeing nami's source code here, I don't think it does. Please see this response to the issue I raised yesterday at CSL Github. They have recently added support for FixedTransaction type which would help get hash (when performing signing) of the original transaction body's cbor.

What is the error you get? Because this: ... has nothing to do with it.

It appears weird to me that I was shown this error at time but now I am adding witness (obtained using wallet's signTx method) to the original transaction cbor in my haskell backend & now I see incorrect witness signature error which is simply because internally Nami changed the transaction body's cbor.


This issue, the way it stands is confusing and maybe I should open an issue at Nami's Github for it. But I guess it is still relevant as you maintain a custom fork of CML.

alessandrokonrad commented 1 year ago

Seeing nami's source code here, I don't think it does

That's just a high level function. This is what actually happens when serializing the body again: https://github.com/berry-pool/cardano-multiplatform-lib/blob/29e726d460d6dfb7f01597e74a451d7479abe558/rust/src/serialization.rs#L291-L293 And here when deserializing the tx in the first place: https://github.com/berry-pool/cardano-multiplatform-lib/blob/29e726d460d6dfb7f01597e74a451d7479abe558/rust/src/serialization.rs#L691

Does this issue only appear with Nami or also with Lucid? What if you try Lucid and another wallet?

sourabhxyz commented 1 year ago

It is indeed not an issue with Nami & Eternl but is with Lace which tricked me into thinking that it is also an issue with Nami. Thanks for awesome work with Nami!