-snip-
Bro,
Bresult=addpt(result, (subptx,subpty), p)
print("result> 04%064x%064x"%Bresult)
aagain generate false result. This is not deducted pubkey+starting range, and I kan't understand what is it and why I can't get previous pubkey then I add range what I deleted early
How to minus range and add after and get result: startpubey=Q(pubkey-range)+range



?
1) You have pub key let`s call this point Pt
2) And you have startrange = 0x800000 for ex. Calculate point from startingrange: x,y = ptmul(g,startrange )
3) make y-coordinate negative using p-y, so you will have point with x,p-y
4) make point addition operation via your pubkey and point from step 2: myX,myY = addpt(Pt, (x,p-y), p)
myX,myY is equil to point Pt from wich substract startrange.
If you need getback to Pt value just add to myX,myY point x,y: backX,backY = addpt((myX,myY) , (x,y), p)
backX,backY will equil to Pt.